jbyrne
03-12-2012, 08:02 PM
Hello :)
Basically I have found and adapted the code:
alreadyloading = false;
nextpage = 2;
$(window).scroll(function() {
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
if (alreadyloading == false) {
var url = "page"+nextpage+".html";
alreadyloading = true;
$.post(url, function(data) {
$('#projectscontainer').children().last().after(data);
alreadyloading = false;
nextpage++;
});
}
}
});
I want when the user scrolls to the bottom of the page for content in a new page to load under the div "#projectscontainer". So in the new page 'Page2.html" I have put 5 divs going down with content in...
I want the new content to appear below "#projectscontainer'"
Why won't this work? Anyone know?
Thanks
Basically I have found and adapted the code:
alreadyloading = false;
nextpage = 2;
$(window).scroll(function() {
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
if (alreadyloading == false) {
var url = "page"+nextpage+".html";
alreadyloading = true;
$.post(url, function(data) {
$('#projectscontainer').children().last().after(data);
alreadyloading = false;
nextpage++;
});
}
}
});
I want when the user scrolls to the bottom of the page for content in a new page to load under the div "#projectscontainer". So in the new page 'Page2.html" I have put 5 divs going down with content in...
I want the new content to appear below "#projectscontainer'"
Why won't this work? Anyone know?
Thanks