Это моя демонстрационная ссылка: http://www.bajistech.info/tiltindicators.html
Мне нужно создать конкретную ссылку для каждой вкладки
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 li a'). click (function() {
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();
}
}
});
Я думаю, это поможет вам:
$('ul#verticalNav li a').click(function(){
return false;
});
вы должны обрабатывать href, когда нажимаете, добавьте этот код в свой JS:
$("#verticalNav li a").click(function(event) { event.preventDefault()});