$(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(){這個函數。有哪位大神遇到過這種問題,了解里面的機制的求解答一下,多謝。
jq scroll綁定問題
開滿天機
2018-10-10 14:11:15