兼容六浮动层代码
兼容6浮动层代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("img").click(function(){ var zai=$("ul li:eq(1)").css("display"); if("none"==zai){ $("ul li:gt(0)").show(1000); }else{ $("ul li:gt(0)").hide(1000); } }); }) </script> <style type="text/css" > ul,li{padding:0px; margin:0px;} li{list-style:none;} .list{ position:absolute; background-color:#EAEAEA; top:10px; left:3px; width: 137px; } .list li{height:24px; float:left; clear:both;} </style> </head> <body> <div style="position:relative; background-color:#000000; height:20px; "> <ul class="list"> <li>我是ul的li的元素,我是ul的li的元素</li> <li>我是ul的li的元素</li> </ul> </div> <br/> <br/> <br/> <br/> </body> </html>