JQ炫酷手风琴导航

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				padding: 0;
				margin: 0;
				list-style: none;
			}
			.content{
				width: 200px;
				position: absolute;
				left: 50%;
				top: 50%;
				margin-left: -100px;
				margin-top: -100px;
			}
			.list{
				width: 100%;
				text-align: center;
			}
			.list ul li p[class=title]{
				width: 100%;
				height: 50px;
				line-height: 50px;
				border-bottom: 1px #ccc solid;
				cursor: pointer;
				background-color: #ee3366;
				font-size: 20px;
				color: white;
			}
			.list ul li p[class=title]:hover{
				background-color: #ee6677;
			}
			.list ul li ul{
				overflow: hidden;
				display: none;
			}
			.list ul li ul li{
				position: relative;
				right: -100%;
				transition: right 0.5s ease-in-out; 
			}
			.list ul li ul li p{
				cursor: pointer;
				height: 50px;
				line-height: 50px;
				background-color: #CCCCCC;
				color: white;
			}
			.list ul li ul li p:hover{
				background-color: #5b5b5b;
			}
		</style>
	</head>
	<body>
		<div class="content">
			<div class="list">
				<ul>
					<li>
						<p class="title">ITEM1</p>
						<ul>
							<li>
								<p>Item1</p>
							</li>
							<li>
								<p>Item2</p>
							</li>
							<li>
								<p>Item3</p>
							</li>
							<li>
								<p>Item4</p>
							</li>
						</ul>
					</li>
					<li>
						<p class="title">ITEM2</p>
						<ul>
							<li>
								<p>Item1</p>
							</li>
							<li>
								<p>Item2</p>
							</li>
							<li>
								<p>Item3</p>
							</li>
							<li>
								<p>Item4</p>
							</li>
						</ul>
					</li>
					<li>
						<p class="title">ITEM3</p>
						<ul>
							<li>
								<p>Item1</p>
							</li>
							<li>
								<p>Item2</p>
							</li>
							<li>
								<p>Item3</p>
							</li>
							<li>
								<p>Item4</p>
							</li>
						</ul>
					</li>
					<li>
						<p class="title">ITEM4</p>
						<ul>
							<li>
								<p>Item1</p>
							</li>
							<li>
								<p>Item2</p>
							</li>
							<li>
								<p>Item3</p>
							</li>
							<li>
								<p>Item4</p>
							</li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
		<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			  $(function(){
			  	$('.list ul li p').on("click",function(){
			  		$(this).stop().siblings('ul').slideToggle('fast')
			  		$(this).stop().parent().siblings().children("ul").slideUp('fast').siblings().slideDown('fast')
			  		var li = $(this).next().children("li")
			  		for(let i = 0 ; i<li.length;i++){
			  			li.eq(i).animate({
			  				"right":0
			  			},i*25)
			  		}
			  		$(this).parent().siblings().children("ul").children("li").css("right","-100%")
			  	})
			  })
		</script>
	</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值