0

I am struct at one point basically i am trying developing IOS (Cordova) application with core javascript without using any framework like ionic,onsen ui etc Problem is that i want scroll stop event when scrolling stop

process :-

When user hit for scroll then scrolling start after sometime scrolling will stop I need scroll stop when scrolling stop.. (need in core javascript without any external JS like J query etc)

Thanks If anyone can help me out from this

Nishant Dixit
  • 5,388
  • 5
  • 17
  • 29
  • 1
    Possible duplicate of [How do I know when I've stopped scrolling Javascript](http://stackoverflow.com/questions/4620906/how-do-i-know-when-ive-stopped-scrolling-javascript) – santosh gore Mar 03 '17 at 10:20
  • Thanks for reply but in this when you remove your finger from mobile then event fire not when scroll stop i want when scroll stop fully (without jquery or other external js ) – Nishant Dixit Mar 03 '17 at 10:26

1 Answers1

0
<script language="javascript">
  var scrollTimer = -1;

    function bodyScroll() {
     document.getElementById("#test") = "scrolling";

    if (scrollTimer != -1)
    {
     clearTimeout(scrollTimer);
     scrollTimer = window.setTimeout("scrollFinished()", 500);
    }

    function scrollFinished() {
    document.getElementById("#test") = "scrolling stopped";
   }
</script>
<body onscroll="bodyScroll();">
  <div id="test"></div>
</body>
santosh gore
  • 319
  • 2
  • 21