移动端返回顶部
功能:
滚动到某个地方显示
事件 scroll 页面滚动事件
代码:
<style>
* {
height: 800px;
}
.nav {
height: 200px;
background-color: aquamarine;
}
.icon {
display: none;
float: right;
width: 40px;
height: 40px;
padding-top: 250px;
}
img {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="nav">顶部</div>