jquery的特效实现???

墙角在唱歌 2012-06-12 03:03:15
<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>

为什么没有反应呢??各位救救我?
...全文
42 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
墙角在唱歌 2012-06-12
  • 打赏
  • 举报
回复
多谢多谢
三石-gary 2012-06-12
  • 打赏
  • 举报
回复
<script>
$(document).ready(function () {
$(".has_childern").click(function () {

$(this).addClass("highlight").children("a").show().end().siblings().removeClass("highlight").children("a").hide();
});
})

</script>

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧