Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yeah pretty much everything can be put inside <code>.scroll()</code> event handler from jQuery.</p> <p><a href="http://api.jquery.com/scroll/" rel="nofollow noreferrer">http://api.jquery.com/scroll/</a></p> <p>And to detect stop check out this post :</p> <p><a href="https://stackoverflow.com/questions/8931605/fire-event-after-scrollling-scrollbars-or-mousewheel-javascript">Fire event after scrollling scrollbars or mousewheel with javascript</a></p> <p>You basically set a Timeout to check if you are still scrolling and if not trigger the stopped scrolling event</p> <p><strong>EDIT: was funny to implement</strong></p> <pre><code>var scrollChecker = null; var scrollTimeout = null; var createScrollEvents = function (e) { var $this = $(this); $this.data('scrolling', true); if (!scrollChecker) { $this.trigger('scrollStart'); scrollChecker = setInterval(function () { if (!$this.data('scrolling')) { $this.trigger('scrollStop'); clearTimeout(scrollChecker); scrollChecker = null; } }, 200); } $this.trigger('scrolling'); if (scrollTimeout) { clearTimeout(scrollTimeout); } scrollTimeout = setTimeout(function () { $this.data('scrolling', false); }, 200); }; $(function () { $('#mydiv') //init .scroll(createScrollEvents) //events .on('scrollStart', function (e) { console.log('start'); }) .on('scrollStop', function (e) { console.log('stop'); }) .on('scrolling', function (e) { console.log('scrolling'); }); //end }); </code></pre> <p><strong>CSS</strong></p> <pre><code>#mydiv { width:200px; height:200px; overflow : auto; } </code></pre> <p>don't forget this, read <code>.scroll()</code> documentation :</p> <blockquote> <p>It applies to window objects, but also to scrollable frames and elements with the <code>overflow</code> CSS property set to <code>scroll</code> (or <code>auto</code> when the element's explicit height or width is less than the height or width of its contents).</p> </blockquote> <p><a href="http://jsfiddle.net/techunter/LxTqY/" rel="nofollow noreferrer">http://jsfiddle.net/techunter/LxTqY/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload