這是我的演示鏈接:http://www.bajistech.info/tiltindicators.htmljquery垂直選項卡,跳轉到頁面頂部,如何停止?
我要創建特定的鏈接,每個標籤
function showSection(sectionID) {
$('div.section').css('display', 'none');
$('div'+sectionID).css('display', 'block');
}
$(document).ready(function(){
if (
$('ul#verticalNav li a').length &&
$('div.section').length
) {
$('div.section').css('display', 'none');
//$('ul#verticalNav li a').each(function() {
//不需要每次循環 $( '#UL李verticalNav一')點擊(功能(){
showSection($(this).attr('href'));
});
//});
if(window.location.hash)
// if hash found then load the tab from Hash id
{
showSection(window.location.hash);// to get the div id
}
else // if no hash found then default first tab is opened
{
$('ul#verticalNav li:first-child a').click();
}
}
});
喜的朋友,謝謝,但我需要顯示標籤ID也喜歡:tiltindicators.html#TiltWatch-PLUS1。 – user2913707