Home >Web Front-end >JS Tutorial >jQuery response to scroll bar event function example
This article mainly introduces jQuery's function of responding to scroll bar events, which can realize real-time calculation and response functions for jQuery scroll bar status. It has certain reference value. Friends who are interested in jQuery can refer to this article. Relevant learning recommendations: jQuery Online Video Tutorial
The example in this article describes the function of jQuery responding to scroll bar events. Share it with everyone for your reference, the details are as follows:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript"> $(function() { var lazyheight = 0; //获取数据 function showload() { lazyheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); if ($(document).height() - 100 <= lazyheight) { alert("xxx"); } } //showload(); //绑定事件 $(window).bind("scroll", function() { //当滚动条滚动时 showload(); }); }) </script> </head> <body> <img src="1.jpg"/><br/> <img src="2.jpg"/><br/> <img src="3.jpg"/> </body> </html>
Related recommendations:
Sharing the difference between jquery and js to realize the select all function
Sharing detailed examples of the use of jQuery.form.js
How to implement modularization in Js
The above is the detailed content of jQuery response to scroll bar event function example. For more information, please follow other related articles on the PHP Chinese website!