这是我的 JavaScript 代码:
<script type="text/javascript">
var showcont = [];
var showcont_containers = [];
$('#tabs ul li a').each(function () {
// note that this only compares the pathname, not the entire url
// which actually may be required for a more terse solution.
if (this.pathname == window.location.pathname) {
showcont.push(this);
showcont_containers.push($(this.hash).get(0));
};
});
$(showcont).click(function(e){
$(showcont_containers).hide().filter(this.hash).fadeIn();
e.preventDefault();
});
</script>
如何添加活动类#tabs ul li a
?请帮我