【问题标题】:Chrome scroll issue inside facebook page tabFacebook页面选项卡内的Chrome滚动问题
【发布时间】:2014-05-31 22:18:44
【问题描述】:

我正在 facebook 页面选项卡内滚动加载数据。它适用于包括 IE 在内的所有浏览器。但在 chrome 中它不起作用。

我在滚动时加载数据的代码

$(window).scroll(function() { //detect page scroll
if($(window).scrollTop() + $(window).height() >= $(document).height())  //user scrolled to bottom of the page?
{
       $.get($('#cmn_scroll_path').val(),{'index': index1,'size':size,'search':search}, function(data){
             $(".scroll-data").append(data); //append received data into the element
             scroll_flag = true;
        }).fail(function(xhr, ajaxOptions, thrownError) { //any errors?
                    $('.loading_image').hide(); 
                    //alert(thrownError); //alert with HTTP error
        });           
}

});

它不在 Windows chrome 中的 $(window).scroll(function() 内。知道如何解决这个问题吗?

【问题讨论】:

    标签: javascript facebook google-chrome scroll facebook-page


    【解决方案1】:

    我更改了窗口以记录它的工作:

    $(document).scroll(function() { //detect page scroll
    if($(document).scrollTop() + $(document).height() >= $(document).height())  //user scrolled to bottom of the page?
    {
           $.get($('#cmn_scroll_path').val(),{'index': index1,'size':size,'search':search}, function(data){
                 $(".scroll-data").append(data); //append received data into the element
                 scroll_flag = true;
            }).fail(function(xhr, ajaxOptions, thrownError) { //any errors?
                        $('.loading_image').hide(); 
                        //alert(thrownError); //alert with HTTP error
            });           
    }
    

    【讨论】:

      猜你喜欢
      • 2012-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-07
      • 2013-03-29
      • 1970-01-01
      相关资源
      最近更新 更多