|
|
@ -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>
|
|
|
|
|
|
|
|
|
|
|
|