日期:
作者: 小胡子哥
function isInViewport(el) {
var rect = el.getBoundingClientRect();
return rect.bottom > 0 &&
rect.right > 0 &&
rect.left < (window.innerWidth || document. documentElement.clientWidth) &&
rect.top < (window.innerHeight || document. documentElement.clientHeight);
}
window.addEventListener('scroll', function() {
isInViewport(el);
})
这网速真是弱爆了...客官稍等,评论还在加载~