Jquery之较动态的导航

1

OL标签为有序列表

<!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" xml:lang="en-us">
<head>
	<title>OL Demo</title>
	<script src="jquery-1.1.3.pack.js"></script>
	<script>
	$(document).ready(function(){
		$("li.item > ol").hide();
		$("li.item").hover(function(){
			$("ol",this).slideDown("fast");//$("ol",this): 寻找this中的ol.
		},function(){
			$("ol",this).slideUp("fast");
		});
	});
	</script>
	<style>
	body { font-family: Arial; font-size: 16px; }
	ol { list-style: none; margin: 0; padding: 0; }
	li.item { float: left; width: 150px; background: #F39; margin: 5px; }
	li.item a { font-size: 18px; color: #FFF; margin: 4px; }
	li.item ol { background: #FFF; margin: 3px; }
	li.item ol a { font-size: 16px; color: #000; margin: 0; }
	</style>
</head>
<body>
<ol class="menu">
	<li class="item"><a href="/">导航1</a>
	<ol>
		<li><a href="/src/">1111</a></li>
		<li><a href="/docs/">2222</a></li>
		<li><a href="/blog/">3333</a></li>
	</ol></li>

	<li class="item"><a href="/discuss/">导航2</a>
	<ol>
		<li><a href="/discuss/">444444</a></li>
		<li><a href="/tutorials/">555555</a></li>
		<li><a href="/demos/">66666</a></li>
		<li><a href="/plugins/">777777</a></li>
	</ol></li>

	<li class="item"><a href="/dev/">导航3</a>
	<ol>
		<li><a href="/src/">88888</a></li>
		<li><a href="/dev/bugs/">999999</a></li>
		<li><a href="/dev/recent/">1</a></li>1111
	</ol></li>
</ol>
</body>
</html>




<!--测试 $(".bmo",".dmo") 选择器-->
<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Demo</title>
	<script src="jquery-1.1.3.pack.js"></script>
	<script>
	$(document).ready(function(){
	   alert($(".bmo",".dmo").html())
	});
	</script>

</head>
<body>
<div class="dmo"><span class="ado"><div class="bmo">aaa</div></span></div>
</body>
</html>
-->
3



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

静山晚风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值