main
AviderMin 1 month ago
parent 586c89601e
commit 5527721515

@ -54,6 +54,15 @@
</p> </p>
</div> </div>
<div class="news-elevator">
<ul class="news-elevator-list">
<li><a href="#"></a>新鲜好物</li>
<li><a href="#"></a>人气推荐</li>
<li><a href="#">热门品牌</a></li>
<li><a href="#">最新专题</a></li>
<li><a href="#">顶部</a></li>
</ul>
</div>
<div class="footer"> <div class="footer">
Web新闻网站 Web新闻网站
</div> </div>
@ -145,7 +154,15 @@
const n1 = document.documentElement.scrollTop const n1 = document.documentElement.scrollTop
navbar.style.top = n1 >= news.offsetTop ? 0 : '-65px' navbar.style.top = n1 >= news.offsetTop ? 0 : '-65px'
}) })
const elevator = document.querySelector('.news-elevator')
window.addEventListener('scroll',function(){
const n = document.documentElement.scrollTop
if (n >=300){
elevator.style.opacity = 1
}else{
elevator.style.opacity = 0
}
})
</script> </script>
</body> </body>

Loading…
Cancel
Save