Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scroll.js 791B

123456789101112131415161718192021222324252627
  1. function inserted(el, binding) {
  2. var callback = binding.value;
  3. var options = binding.options || { passive: true };
  4. var target = binding.arg ? document.querySelector(binding.arg) : window;
  5. if (!target) return;
  6. target.addEventListener('scroll', callback, options);
  7. el._onScroll = {
  8. callback: callback,
  9. options: options,
  10. target: target
  11. };
  12. }
  13. function unbind(el) {
  14. if (!el._onScroll) return;
  15. var _el$_onScroll = el._onScroll,
  16. callback = _el$_onScroll.callback,
  17. options = _el$_onScroll.options,
  18. target = _el$_onScroll.target;
  19. target.removeEventListener('scroll', callback, options);
  20. delete el._onScroll;
  21. }
  22. export default {
  23. inserted: inserted,
  24. unbind: unbind
  25. };
  26. //# sourceMappingURL=scroll.js.map