0
我的问题是这样的 - 我在一个网站上创建了一个顶栏横幅,通过鼠标悬停在桌面上。在移动设备上,当您点击该横幅时,横幅会拉下 - 如果您在页面上点击横幅以外的任何地方,则横幅会恢复。当您再次单击该横幅时,需要将该横幅消失,而不必点击页面使其消失。如何在点击移动设备时更改横幅位置?
这是我目前的CSS:
aside.banner-container {
width: 100%;
height: 150px;
background: #000;
border-bottom: 1px solid rgba(255,255,255,0.6);
position: absolute;
top: -135px;
cursor: pointer;
margin: 0px auto;
padding-bottom: 10px;
-webkit-transition: top 1s ease;
-moz-transition: top 1s ease;
transition: top 1s ease;
z-index: 999;
}
.banner-container:hover, .banner-container:focus, .banner-container:active {
position: absolute;
top: 0px;
}
JSP页面是否有差别。研究我可以在Javascript中看到onClick事件,但是如果我告诉定位是“top:-135px”,onClick是否会与首次点击发生混淆?或不,因为这是从技术上悬停?
很棒,谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :) –