公告

更新

 

互联网 JS控件 按钮 黑色 灰色 白色 蓝色 绿色 黄色 橙色

> 代码 > 菜单

兼容IE6 7 8 FF下拉菜单支持IE6:hover属性
0
作者:vip_260     来源:未知     日期:2010/1/8 16:20:51     人气:      标签:

兼容IE6 7 8 FF下拉菜单支持IE6:hover属性

<style type="text/css">
<!--
*{ margin:0; padding:0;}
.s1{ width:300px; height:30px; overflow:hidden; margin:0px auto 0px auto;}
#s2{width:300px; height:30px; overflow:hidden;}
#s2 .b1{width:100px; height:30px; overflow:hidden; float:left; background:#CCC; text-align:center;}
#s2 .b1 .b2{ position:absolute; margin:30px auto auto -74px; display:none; background:#09F;width:100px; height:30px; overflow:hidden;}
#s2 .b1:hover .b2{ display:block;}
-->
</style>


<script type="text/javascript">
function fnOver(thisId,showid){
 
    var thisClass = thisId.className;
    var overCssF = thisClass;
    if(thisClass.length>0){thisClass = thisClass+" "};
    thisId.className = thisClass + overCssF+"hover";
 
 document.getElementById(showid).style.display="inline";
}
function fnOut(thisId,hidid){
    var thisClass = thisId.className;
    var thisNon = (thisId.className.length-5)/2;
    thisId.className=thisClass.substring(0, thisNon);
 document.getElementById(hidid).style.display="none";
}
</script>

<!--修改用的时候只需要修改onmouseover="fnOver(this,'b2')和id="b2"就可以用了-->
<div class="s1">
  <div id=s2>
     <div class="b1" onmouseover="fnOver(this,'b2')" onmouseout="fnOut(this,'b2')">网站频道
       <div class="b2" id="b2">www.v404.cn</div>
     </div>
    
    
    
     <div class="b1">测试2</div>
     <div class="b1">测试3</div>
  </div>
</div>

Copyright 2008 网站频道 All Rights Resverved.
提供:网页特效 JS广告 网站截图 酷站推荐 交流群:3506863
     页面执行时间0.0625秒 查询数据库8次