我想直接链接从锚链接像回到3选项卡我不能让它工作。它从菜单上完美地工作,但是当我试图从tab5链接到tab3不能与锚点一起工作。直接链接到选项卡从锚链接
这是我使用的JS。
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.tabs .tab-links a').on('click', function(e) {
var currentAttrValue = jQuery(this).attr('href');
// Show/Hide Tabs
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
// Change/remove current tab to active
jQuery(this).parent('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
});
</script>
我的代码有问题或缺失?
添加HTML代码,请。 –