我将以下代码用于一些简单的选项卡,并且想知道是否可以编辑此代码以启用深度链接?我没有使用 jQuery UI,也不想使用插件。提前欢呼任何帮助。
$('#tabber > div').hide(); // Hide all divs
$('#tabber ul li a').click(function () { // When link is clicked
$('#tabber ul li').removeClass('active'); // Remove active class from links
$(this).parent().addClass('active'); //Set parent of clicked link class to active
var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
$('#tabber > div').fadeOut(200); // Hide all divs
$(currentTab).fadeIn(200); // Show div with id equal to variable currentTab
return false;
});