我正在使用window.scroll
函数,但window.scrollTop
没有在闪电控制器中返回任何值。帮我。
initialize : function(component, event, helper) {
var isHidden = false
var lastScrollTop = 0
console.log('heyyyyyy');
window.addEventListener('scroll', function() {
console.log('heyasasyyyyy');
var scrollTop = document.documentElement.scrollTop;
var offset = scrollTop-lastScrollTop ;
lastScrollTop = scrollTop ;
console.log(scrollTop+'++++'+offset+'++++++'+lastScrollTop);
});
},