JS checks whether the scroll bar stops scrolling, and is compatible with IE and Firefox browsers.

Source: Internet
Author: User

A recent project encountered such a problem:

There is a DIV block with a scroll bar for displaying data. The business requirement is to read and display the data in the database when the scroll bar is rolling. This is not a problem in itself, but in reality it is found that when the data volume is large, when the scroll bar is rolling, it will not stop sending data requests to the background, this puts huge pressure on servers and browsers when the traffic volume reaches a certain scale.

To solve this problem, the author thought of a way to send request data to the server only when the scroll bar is stopped. But how can I determine whether the scroll bar is stopped? After several studies, I finally solved the problem. Here I will share with you how to use js to determine whether the browser's scroll bar stops rolling (the effect here is compatible with IE and Firefox browsers ).

<Html xmlns = "http://www.phpernote.com/javascript-function/194.html"> 

The above can change the time for regular judgment. The shorter the time, the more timely the corresponding time, the better the user experience, but the pressure on the corresponding client browser will increase.

Articles you may be interested in
  • Move the mouse over the text to display the floating layer prompt special effects (compatible with all browsers such as IE and Firefox)
  • Display text box effects of line numbers, compatible with browsers such as ie and Firefox
  • Javascript determines whether the mouse is left or right-click-compatible with ie, firefox, chrome, and other major browsers
  • How to solve the problem that the DIV layer is covered by Flash (compatible with IE and Firefox browsers) and how to display the DIV layer on FLASH
  • JS obtains the key code, how Js shields users' keys, and Js obtains the ASII code corresponding to users' keys (compatible with all browsers)
  • DIV layer that slides with the scroll bar (fixed to the DIV layer that does not disappear with browsing on the top of the page)
  • How to set the DIV layer to display on a flash object, compatible with browsers such as ie and firefox
  • Jquery drop-down menu (ultra-simple and practical, compatible with mainstream browsers such as IE and firefox)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.