估计导航用的fixed定位吧,
var windheight =window.innerHeightvar bottomx = document.getElementById('bottomx') //底部导航
window.onresize(function(){ var docheight = window.innerHeight
if(docheight < windheight){
bottomx.style.position = 'static'
}else{
bottomx.style.position = 'fixed'
}
})
<style type="text/css">#daohang{ width:900px}
#daohang ul{ list-style:none}
#daohang ul li{ width:100pxdisplay:blockbackground:#999999float:lefttext-align:center}
#daohang ul li:hover{}
#daohang ul li a{text-decoration:nonedisplay:block}
#daohang ul li a:hover{ background:#FF0000color:#000000text-decoration:none}
</style>
<div id="daohang">
<ul>
<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>
<li><a href="">菜单六</a></li>
</ul>
</div>
看看行不行
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)