Bugfix: There were speed problems with inifinite scroll on firefox
This commit is contained in:
parent
eaefcf9de7
commit
0b31aa963d
2 changed files with 13 additions and 9 deletions
16
index.php
16
index.php
|
@ -494,13 +494,15 @@ var num = $pageno;
|
|||
|
||||
$(window).scroll(function(e){
|
||||
|
||||
// First method that is expected to work - but has problems with Chrome
|
||||
if ($(window).scrollTop() == $(document).height() - $(window).height())
|
||||
loadcontent();
|
||||
|
||||
// This method works with Chrome
|
||||
if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height()))
|
||||
loadcontent();
|
||||
if ($(document).height() != $(window).height()) {
|
||||
// First method that is expected to work - but has problems with Chrome
|
||||
if ($(window).scrollTop() == $(document).height() - $(window).height())
|
||||
loadcontent();
|
||||
} else {
|
||||
// This method works with Chrome - but seems to be much slower in Firefox
|
||||
if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height()))
|
||||
loadcontent();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue