<!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 ">
<Kopf>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javaScript" type="text/Javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(Funktion () {
/* $("#mainNav .item").mouSEOver(function() {
var $ul = $(this).find("ul");
$ul.slideDown(500)
})
$("#mainNav .item").mouseout(function () {
var $ul = $(this).find("ul");
$ul.slideUp(500);
})*/
/* 当鼠标从SPAN中一出来时触发了mouseout事件由于事件冒泡也出发了.item的onmouseout事件二级菜单消失,但此时又移入了item又触发了mouseover事件所以又显示出来.这时就会出现先消失在出来的情况.
*/
$("#mainNav .item").hover(
Funktion() {
var $ul = $(this).find("ul");
$ul.slideDown(500);
},
Funktion () {
var $ul = $(this).find("ul");
$ul.slideUp(500);
}
)
/*
$("#mainNav .item").each(function(){
var $thisItem = $(this);
$thisItem.hover(
Funktion () {
var $thisUl = $thisItem.find("ul");
//$thisUl.slideToggle(500);
$thisUl.slideDown(500);
},
Funktion(){
var $thisUl = $thisItem.find("ul");
$thisUl.slideUp(500)
}
);
});
*/
/* $("#mainNav .item span").mouseover(function() {
var $ul = $(this).next();
$ul.show()
})
$("#mainNav .item").mouseout(function () {
var $ul = $(this).find("ul")
$ul.hide();
})
*/
})
//http://www.happinesz.cn/archives/1020/
</script>
<style type="text/CSS">
body{ margin:10 auto; Polsterung:0; Schriftgröße:14px;}
ul,li{ margin:0; Polsterung:0}
#mainNav{ list-style-type:none}/*在IE中给ul设置了list-style-type会将应用到所有子li中,FF中只会应用到1级的li*/
#mainNav li.item { float:left; margin-left:50px; Breite:80px; *display:inline; /*für zB 6*/ }
#mainNav li.item span{ text-align:center; Anzeige:Block; width:98%;border:1px solid #000;}
#mainNav li.item ul{list-style-type:none;}/*FF需要重新给ul设置list-style-type*/
#mainNav li.item ul{ display:none; Hintergrundfarbe:#CCC}
div.test{ height:30px; Breite:50px; margin-left:50px; border:1px solid #ccc}
</style>
</head>
<Körper>
<ul id="mainNav">
<li class="item">
<span><strong>新闻</strong></span>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</li>
<li class="item">
<span> <strong>产品</strong></span>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</li>
<li class="item">
<span><strong>公司</strong></span>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</li>
</ul>
</body>
</html>
-