function isScrolledIntoView(o,r){ o=$(o); var t=$(window), r=r||0, e=t.scrollTop(), i=e+t.height(), n=o.offset().top+r, f=n+o.height(), h=n>i; console.log(o.offset().top); if(h) return!1; var l=f>e; return l?!(h&&l):!1}瀏覽器報(bào)錯(cuò)Cannot read property 'top' of undefined但我console.log就能輸出這個(gè)值,請(qǐng)問是什么問題?
offset().top顯示undefined但實(shí)際調(diào)用卻有效
四季花海
2018-08-11 09:10:17