Stworzyllem pewien szablon na potrzeby aukcji i ... mam problem z kotwicami umieszczonymi w menu górnym i stopce. Na czym polega feler: przykładowo klikam na link 'about us' znajdujący się w górnym menu i zostaję przeniesiony do taba o nazwie 'About Us' - tutaj jest ok, ale gdy w menu górnym, czy w stopce kliknę na link 'Shipment' to nie działa przełączanie do odpowiedniego taba. Zresztą przetestujcie sami: http://ebay.mydesign.radom.pl/
Poniżej podaję fragmenty kodu.
xHTML (menu górne):
xHTML (taby):
<!-- start of tabs --> <ul class="tabs"> </ul> <!-- end of tabs --> <!-- start of div that hold all the tabbed contents --> <div class="tab_contents_container"> <!-- start of Tab 1 Contents - About Us --> <div id="about" class="tab"> </div> <!-- end of Tab 1 Contents - About Us --> </div> <!-- end of div that hold all the tabbed contents -->
jQuery (taby):
Kod
$(document).ready(function() {
$('.tabs').each(function() {
var $ul = $(this);
var $li = $ul.children('li');
$li.each(function() {
var $contentTab = $($(this).children('a').attr('href'));
if ($(this).hasClass('active')) {
$contentTab.show();
} else {
$contentTab.hide();
}
});
$li.click(function() {$(this).children('a').click()});
$li.children('a').click(function() {
if (!$(this).parent().hasClass('disable')) {
$li.removeClass('active');
$li.each(function() {
$($(this).children('a').attr('href')).hide();
});
$(this).parent().addClass('active');
$($(this).attr('href')).show();
} else {
$(this).blur();
}
return false;
});
});
});
$('.tabs').each(function() {
var $ul = $(this);
var $li = $ul.children('li');
$li.each(function() {
var $contentTab = $($(this).children('a').attr('href'));
if ($(this).hasClass('active')) {
$contentTab.show();
} else {
$contentTab.hide();
}
});
$li.click(function() {$(this).children('a').click()});
$li.children('a').click(function() {
if (!$(this).parent().hasClass('disable')) {
$li.removeClass('active');
$li.each(function() {
$($(this).children('a').attr('href')).hide();
});
$(this).parent().addClass('active');
$($(this).attr('href')).show();
} else {
$(this).blur();
}
return false;
});
});
});
W jaki sposób poprawić funkcjonalność kotwic umieszczonych w górnym menu i stopce, tak aby przenosiły do odpowiednich tabów niezależnie od aktywnego elementu umieszczonego w tabie?
Prosiłbym o wyrozumiałość i pomoc.