iPhone and iPad end of scrolling

ぐ巨炮叔叔 提交于 2019-12-22 07:04:21

问题


I'm making some jQuery cross-browser gallery with infinite scroll i works great but on iPhone (i suppose also on iPad) instead equal values i have some disproportion values don't match

($(window).scrollTop() == ($(document).height() - $(window).height()) 

i just want to reach the end of scrolling on that , after that i could invoke AJAX script, also have to keep in mind that values changing after two fingers wipe zoom.


回答1:


You need to account for the 60px URL text field on iPhone. Try this:

($(window).scrollTop() + 60 == ($(document).height() - $(window).height()) 



回答2:


var wintop = $(window).scrollTop(), docheight = $(document).height(), winheight = $(window).height();
        var  scrolltrigger = 0.90;

        if  ((wintop/(docheight-winheight)) > scrolltrigger) {

            //Your AJAX CALL HERE
        }
    });


来源:https://stackoverflow.com/questions/4769487/iphone-and-ipad-end-of-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!