博客更新:2010-09-02 17:18:01 - 解决部分用户访问www.wetuan.com打开企业邮箱的问题

[jQuery学习日志]第一个jQuery代码,动态显示导航菜单

发布时间:2010-01-16 00:16:31,阅读人数:170

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="scripts/jquery.min.js" type="text/javascript"></script>
<title>第一个jQuery代码</title>
<style type="text/css">
div{ width:200px; background-color:#ccc;}
div ul{ background-color: #666; list-style: none; margin: 0px; padding: 0px; color: #ccc;}
div ul li{ background-color:#ccc; color: #000; display: none;}
.show{ color: #fff; background-color: #000;}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("ul").click(function(){
$(this).addClass("show")
.children("li").show().end()
.siblings().removeClass("show")
.children("li").hide();
})
})
</script>
</head>
<body>
<div>
<ul>1
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
<li>1.4</li>
<li>1.5</li>
</ul>
<ul>2
<li>2.1</li>
<li>2.2</li>
<li>2.3</li>
<li>2.4</li>
<li>2.5</li>
</ul>
<ul>3
<li>3.1</li>
<li>3.2</li>
<li>3.3</li>
<li>3.4</li>
<li>3.5</li>
</ul>
</div>
</body>
</html>

发布人:Interner 10'

我也要说两句

  • 称呼:
  • 邮箱:
  • 主页:
  • 内容:

来自客户的声音

“网站整体风格符合我公司的新概念娱乐文化,中英文无缝切换模式体现了源于思想的技术能力和创新思想。我们很满意,期待再一次的合作!”

新影视娱乐文化传播
2009年5月1日