首先我们在#menu2放置一个菜单列表
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script> $(function() {
$("#menu2 li a").wrapInner('<span class="out"></span>'); //所有a标签子级都加上span.out
$("#menu2 li a").each(function() { //所有a标签都加上.over,并附带a标签的文字
$('<span class="over">' + $(this).text() + '</span>').appendTo(this);
});
$("#menu2 li a").hover(function() { //当悬浮a标签时
$(".out", this).stop().animate({
'top': '48px'
},
300); // move down - hide
$(".over", this).stop().animate({
'top': '0px'
},
300); // move down - show
},
function() { //当离开a标签时
$(".out", this).stop().animate({
'top': '0px'
},
300); // move up - show
$(".over", this).stop().animate({
'top': '-48px'
},
300); // move up - hide
});
});
*
回帖描述:*
链接类型:*
下载链接:*
描述:*
回帖描述:*
链接类型:*
阅读权限:*
下载链接:



聚优部落技术论坛 © 版权所有 鲁ICP备15007479号-6
Copyright(C)web.com, All Rights Reserved.
