R
R
RMate2019-02-13 11:39:17
Vue.js
RMate, 2019-02-13 11:39:17

How to track scroll event ON ELEMENT?

Actually, the subject, you need to catch the scroll event directly on the element, something like $ element.bind('mousewheel', ...) in jQuery. Is there such an event? searching for nothing sensible except for crutches did not find

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-02-13
@RMate

you need to catch the scroll event

something like $element.bind('mousewheel',

So scroll, or mouse wheel? You already decide.
Well, it's quite simple:
<div @wheel="onWheel" @scroll="onScroll">
methods: {
  onWheel() {
    console.log('wheel');
  },
  onScroll() {
    console.log('scroll');
  },
},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question