$(window).scroll(function(){ var documentTop = $(document).scrollTop(); var windowHeight = $(window).height(); var documentHeight = $(document).height(); //var txt = "windowHeight:"+windowHeight + " |*$*| documentTop:"+documentTop + " |*$*| documentHeight:"+documentHeight; //当 documentTop >= (documentHeight-windowHeight) 说明滚动条已经滚动到底部了 if(documentTop >= (documentHeight-windowHeight)){ console.log("加载"); var tableTxt = $("#table").html(); $("#txt").append("<hr>" + tableTxt); } })今天用这段代码在自己电脑上面和工作机上面运行都没问题,scroll生效,但是放到项目里面没法生效,debug js代码的时候,发现进不去$(window).scroll(function(){这个函数。有哪位大神遇到过这种问题,了解里面的机制的求解答一下,多谢。
添加回答
举报
0/150
提交
取消