【发布时间】:2016-07-21 14:10:18
【问题描述】:
jQuery(document).ready(function() {
jQuery(".page-contents div").hide();
// Show chosen div, and hide all others
jQuery("a").click(function (e) {
//e.preventDefault();
jQuery("#" + jQuery(this).attr("class")).show().siblings('div').hide();
});
});
有人能解释一下我是如何修改这段代码的,以便将“活动”类添加到所选链接,以及它是如何工作的吗?提前谢谢你
【问题讨论】:
标签: javascript jquery