0
我正在使用window.scroll
函數,但window.scrollTop
沒有在雷電控制器中返回任何值。幫我。我的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);
});
},