<script src="file:///D|/jquery/jquery-1.3.2.js" type="text/javascript"></script>
<script>
$("has_childern").click(function(){
$(this).addClass("highlight")
.children("a").show().end()
.siblings().removeClass("highlight").children("a").hide();
});
</script>
<style type="text/css">
#menu{ width:300px;}
.has_childern{ background:#000; color:#fff; cursor: pointer}
.highlight{ color:#fff; background: green;}
div{ padding:0; margin:10px 0;}
div a{ background:#888; display:none; float:left; width:300px;}
</style>
</head><body>
<div id="menu">
<div class="has_childern">
<span>服装设计</span>
<a>1、绘描</a>
<a>2、ps</a>
<a>3、色彩学</a>
</div>
<div class="has_childern">
<span>美食</span>
<a>1、炒菜类</a>
<a>2、煨汤类</a>
<a>3、蒸食类</a>
</div>
<div class="has_childern">
<span>外语</span>
<a>1、英语</a>
<a>2、日语</a>
<a>3、德语</a>
</div>
</div>
</body>为什么没有反应呢??各位救救我?
<script>
$("has_childern").click(function(){
$(this).addClass("highlight")
.children("a").show().end()
.siblings().removeClass("highlight").children("a").hide();
});
</script>
<style type="text/css">
#menu{ width:300px;}
.has_childern{ background:#000; color:#fff; cursor: pointer}
.highlight{ color:#fff; background: green;}
div{ padding:0; margin:10px 0;}
div a{ background:#888; display:none; float:left; width:300px;}
</style>
</head><body>
<div id="menu">
<div class="has_childern">
<span>服装设计</span>
<a>1、绘描</a>
<a>2、ps</a>
<a>3、色彩学</a>
</div>
<div class="has_childern">
<span>美食</span>
<a>1、炒菜类</a>
<a>2、煨汤类</a>
<a>3、蒸食类</a>
</div>
<div class="has_childern">
<span>外语</span>
<a>1、英语</a>
<a>2、日语</a>
<a>3、德语</a>
</div>
</div>
</body>为什么没有反应呢??各位救救我?
解决方案 »
- 关于时间格式的问题
- javascript调用ruby方法
- Jquery 循环问题
- javascript中的replace函数同时替换多个字符串
- 如何修改flash新闻切换图片中的链接文字的颜色。
- 为元素指定事件方法该怎么写啊?谢谢
- 求助 .NET 拼凑 JS 语句 加\N\R 不自动换行 有高手知道解决方法么 40分 回答完马上节贴
- 用js如何进行html编码,如vb下的server.HtmlEncode?
- 如何用javascript在一个form里添加新成员变量?
- 小问题,如何比较两个日期的大小(1982-3)(年-月)
- js离开页面怎么写
- 如何用JS解决图片放大和旋转90的功能?且兼容Firefox呢?
$(document).ready(function () {
$(".has_childern").click(function () {
$(this).addClass("highlight").children("a").show().end().siblings().removeClass("highlight").children("a").hide();
});
})
</script>