Download Fore_End/cpcn2/node_modules/element-ui/src/directives/mousewheel.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 553 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/src/directives/mousewheel.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/element-ui/src/directives/mousewheel.js
-
curl -L -o mousewheel.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/src/directives/mousewheel.js
553 Bytes
| import normalizeWheel from 'normalize-wheel'; | |
| const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1; | |
| const mousewheel = function(element, callback) { | |
| if (element && element.addEventListener) { | |
| element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function(event) { | |
| const normalized = normalizeWheel(event); | |
| callback && callback.apply(this, [event, normalized]); | |
| }); | |
| } | |
| }; | |
| export default { | |
| bind(el, binding) { | |
| mousewheel(el, binding.value); | |
| } | |
| }; | |