【发布时间】: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