日期:2014-05-16  浏览次数:20306 次

jquery的特效实现???
<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>
$(document).ready(function () {
$(".has_childern").click(function () {

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

</script>