$(window).scroll(function(){ var documentTop = $(document).scrollTop(); var windowHeight = $(window).height(); var documentHeight = $(document).height(); //var txt = "windowHeight:"+windowHeight + " |*$*| documentTop:"+documentTop + " |*$*| documentHeight:"+documentHeight; //當(dāng) documentTop >= (documentHeight-windowHeight) 說明滾動條已經(jīng)滾動到底部了 if(documentTop >= (documentHeight-windowHeight)){ console.log("加載"); var tableTxt = $("#table").html(); $("#txt").append("<hr>" + tableTxt); } })今天用這段代碼在自己電腦上面和工作機(jī)上面運(yùn)行都沒問題,scroll生效,但是放到項目里面沒法生效,debug js代碼的時候,發(fā)現(xiàn)進(jìn)不去$(window).scroll(function(){這個函數(shù)。有哪位大神遇到過這種問題,了解里面的機(jī)制的求解答一下,多謝。
jq scroll綁定問題
開滿天機(jī)
2018-10-10 14:11:15