解决object、embed在div层下的方法

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>模仿美丽说导航</title>
<meta name="keywords" content="模仿,导航,浮动导航,css,jquery" />
<meta name="desCription" content="模仿,导航,浮动导航,css,jquery" />
<!--css , js-->

    <style type="text/css">
	*{margin:0px; padding:0px;}
	body{ _background-attachment:fixed; _background-image:url(about:blank);} /*实现ie6不支持fixed方法*/
	#nav{width:100%; height:45px; background-color:#dd4250;}
	#nav ul{width:720px; margin:0px auto;}
	#nav ul li{float:left;
	             list-style-type:none;
				 width:120px;
				 height:45px; text-align:center;line-height:45px;
				 font-size:16px;font-family:"楷体_GB2312","宋体",Arial, Helvetica, sans-serif;}
	#nav ul li a{color:#FFFFFF; text-decoration:none;
	display:block; }
	#nav ul li a:hover{ background-color:#0000FF;}
    #content{height:1800px;background:#d5d5d5;position:relative;z-index:1;}
	#top{height:100px;}
	.navscroll{position:fixed; top:0px; left:0px;
	_position:absolute;/*兼容ie6*/
	_top: expression(offsetParent.scrollTop);/*兼容IE6*/
	z-index:2;}
	table { border-collapse: collapse; border-spacing: 0;position:relative;}
	td,th{white-space:normal; word-break:break-all;font-weight:normal; margin:0px;padding:0px; border:0px;}
    </style>


</head>

<body>
<div id="top"><img src="tupian/wangyetou0.JPG" class="test1" width="100"/></div>
     <div id="nav">
	     <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>
 <script language="javascript" type="text/javascript" src="C:/Documents and Settings/Administrator/桌面/jquery-1.10.2.js"></script>
 <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>-->
 <script type="text/javascript">
    $(document).ready(function(){
                var topMain=$("#top").height()//是头部的高度加头部与nav导航之间的距离。
                var nav=$("#nav");
                $(window).scroll(function(){//如果滚动条顶部的距离大于topMain则就nav导航就添加类.nav_scroll,否则就移除。
                        ($(window).scrollTop()>topMain)?nav.addClass("navscroll"):nav.removeClass("navscroll");
                });
             })
</script>

<div id="content">
 <table>
    
     <tr>
       <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="680" height="577">
           <param name="movie" value="flash/yingjiban/yingjiban.swf" />
           <param name="quality" value="high" />
		   <param value="opaque" name="wmode">
           <embed src="flash/yingjiban/yingjiban.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="680" height="577"  wmode="opaque"></embed>
       </object></td>
     </tr>
     </table>
</div>

</body>
</html>
加属性:<param name="wmode" value="transparent"|"opaque" />
并且<embed wmode="opaque"></embed>
再设置你原来被盖住的div层的z-inex大于flash所在层就行了.


你可能感兴趣的:(导航)