导航模仿IBM

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>IBM 导航</title>
	<link rel="stylesheet" href="style.css">
	<style type="text/css">
		*{margin:0; padding: 0;}
		body{ text-align: center; color: #333; font-size: 12px;}
		ul,li{ list-style: none;}
		.wrapper{ width: 1000px; text-align: left; margin: 0 auto;}
		.cf:before,.cf:after{ content:''; display:table;}
		.cf:after{clear:both;}
		.cf{zoom:1;}
		#nav{ height: 40px; line-height: 40px; background-color: #333; width: 100%;}
		#nav .list li{ width:120px; float: left; height: 40px; line-height: 40px; color: silver; font-size: 16px; border-right:1px solid #444; text-align: center; cursor: pointer;}
		#nav #navBg{ background-color: #888; height: 200px; display: none;}
		#nav #navBg .wrapper{ width: 1000px; overflow: hidden; height: 200px; position: relative; margin:0 auto;}
		#nav #navBg .wrapper .navBox{ width:5000px; height: 200px; margin:0 auto; position: relative;}
		#nav .navBox .item{ float: left; width: 1000px; height: 200px;}
		#nav #navBg .top{border:10px solid #888; border-bottom:10px solid #fff; position: absolute; bottom:0; left:50%; margin-left:-5px;}
	</style>
	<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
	<script>
	$(function(){
		$('#nav .list>li').click(function(){
			$('#navBg').slideDown('slow');
			var s = $(this).index('li');
			var left = s * 1000;
			$("#navBg .navBox").animate({right:left});
		});
		$('#nav').mouseleave(function(){
			setTimeout(function(){$('#navBg').slideUp('slow');},500);
		});
		$('#nav #navBg .top').click(function(){
			$('#navBg').slideUp('fast');
		});
	});
	</script>
</head>
<body>
	<div id="nav">
		<div class="wrapper">
			<ul class="list cf">
				<li>首页</li>
				<li>读书</li>
				<li>旅游</li>
				<li>篮球</li>
				<li>吉他</li>
			</ul>
		</div>
		<div id="navBg">
			<div class="wrapper">
				<div class="navBox cf">
					<div class="item">111111111</div>
					<div class="item">222222222</div>
					<div class="item">333333333</div>
					<div class="item">444444444</div>
					<div class="item">5555555555555</div>
				</div>
				<div class="top"></div>
			</div>
		</div>
	</div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值