<!DOCTYPE html>
<html>
<head>
<title>shangji4.html</title>
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<style type="text/css">
* {
margin: 0px;
padding: 0px; font-size: 12px;
}
a {
color: #000;
text-decoration: none;
}
#menu {
margin: 30px;
width: 188px;
background-color: #EFFDFA;
}
#menu .top {
height: 40px;
line-height: 40px;
font-size: 14px;
font-weight: bold;
text-align: center;
border: 1px solid #93D6C5;
border-bottom: none;
}
#menu ul.nav {
list-style: none;
}
#menu ul.nav li {
display: block;
height: 30px;
line-height: 30px;
border: 1px solid #93D6C5;
border-top: none;
padding-left: 30px;
background: url(图片/point.jpg) no-repeat 15px center;
}
#menu ul.nav li.lastone {
border: none;
cursor: pointer;
background: #fff url(图片/up.jpg) no-repeat center top;
}
#menu ul.nav li.up {
background: #fff url(图片/down.jpg) no-repeat center top;
}
span.icon {
float: right;
margin-right: 10px;
margin-top: 10px;
}
</style>
<script type="text/javascript">
$(function () {
$("#menu li.lastone").click(function () {
//切换菜单
$("#menu li:gt(8):not(:last)").toggle();
//更换底部夹头方向
$(this).hasClass("up") ? $(this).removeClass("up") : $(this).addClass("up");
});
//添加箭头
$("#menu .nav li a").after('<span class="icon"><img src="图片/icon1.jpg"></span>');
});
</script>
</head>
<body>
<div id="menu">
<div class="top">全部商品详细分类</div>
<ul class="nav">
<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>
<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>
<li><a href="#">手机、数码</a></li>
<li><a href="#">电脑办公</a></li>
<li class="lastone"></li>
</ul>
</div>
</body>
</html>
jQuery快速高效制作网页交互特效第五章课后4
最新推荐文章于 2020-08-16 21:32:02 发布