您的位置:首页 > Web前端 > JQuery

一个最简单的jQuery手风琴效果

2012-02-11 14:41 316 查看
<!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=utf-8" />
<script language="javascript" src="../../js/jquery.js"></script>
<script language="javascript">
$(document).ready(function(){
$('.item').hover(
function(){
$(this).stop().animate({width:400},'slow');
},
function(){

$(this).stop().animate({width:80},'slow');
}
);
})
</script>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
#menu{
width:800px;
height:300px;
}
.item{
width:80px;
height:100%;
float:right;
background:url(20110425062745883.jpg) no-repeat;
}
</style>
<title>手风琴</title>
</head>

<body>
<div id="menu">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息