jQuery 复习之选项卡 简洁代码
<html>
<head>
<script src='js/min.js'></script>
<script src='js/card.js'></script>
</head>
<body>
<div class="tab">
<div class="tab_menu">
<ul>
<li class="tab_selected">时事</li>
<li>体育</li>
<li>娱乐</li>
</ul>
</div>
<div class="tab_content">
<div>时事</div>
<div class="hide">体育</div>
<div class="hide">娱乐</div>
</div>
</div>
</body>
</html>
$(function(){
$('.tab_menu li').click(function(){
$(this).css({'background':'red'}).siblings().css({'background':''});
$('.tab_content div').eq($(this).index()).show().siblings().hide();
});
})
补充:web前端 , JavaScript ,