javascript - How to load a new page/url when user reach the bottom -
i creating infinite load,means new page gets loaded when user reach bottom of page/particular div. have code load new page on click.
$("#about").click(function(){ // load page on click $("#response").load("about.html"); }); does here have more clear thought of how load new page without click/reaching bottom
you can send ajax phone call based on mouse window position.
var no=1; $(window).scroll(function () { if(no==1) { if ($(window).height() + $(window).scrolltop() == $(document).height()) { no=2; $.ajax({ type: "post", url: "about.html", data: datas, cache: false, success: function(html){ } }); } } }); this ajax phone call call when user reaches @ end of page. can specify height @ occurs.
javascript jquery ajax infinite-scroll
No comments:
Post a Comment