【发布时间】:2021-07-17 08:51:12
【问题描述】:
我在页脚有一个带有 HIDE 按钮的粘性广告,
当我点击 HIDE 时我想要 .stickyads 内容应该通过向下滑动来隐藏,但是隐藏,但应该会出现,以便当我再次单击时,.stickyads 内容应该会通过向上滑动出现。
CSS:
@media (max-width: 800px) {
.stickyads {
position: fixed;
bottom: 0px;
left: 0;
}
.stickyadsHide {
width: 30px;
height: 30px;
display: flex;
position: absolute;
right: 0px;
top: -30px;
}
.stickyads .stickyadsContent {
overflow: hidden;
display: block;
position: relative;
width: 100%;
}
}
HTML 部分:
<div class='stickyads'>
<div class='stickyadsHide' >
<span>HIDE</span>
</div>
<div class='stickyadsContent'>
Content Here...
</div>
</div>
【问题讨论】:
-
...有什么问题?
-
javascript代码在哪里?
标签: javascript css show-hide