javascript - How to check scroll to element from different page? -
i have scroll on 2 different pages in site when scroll in 1 of them both pages load own scroll data. don't want load scrolling of site @ once; want load page scroll only.
page1.php
<div id="page1"></div>
page2.php
<div id="page2"></div>
load.js
$(window).scroll(function() { if ($(window).scrolltop() + $(window).height() >= $(document).height()) { page1(); page2(); } }); function page1(load) { $("#page1").text("page1"); } function page2(load) { $("#page2").text("page2"); }
wiki
Comments
Post a Comment