react 移動端 監聽滾動事件 獲取滾動條距頂部距離

嘗試了不少中方法,用下面代碼實現了javascript componentDidMount(){ window.addEventListener('scroll', this.handleScroll); } handleScroll(){ console.log(window.scrollY) }
相關文章
相關標籤/搜索