Ahoj, našel jsem stránku o tabs (http://broadcast.oreilly.com/2008/10/ho ... ss-an.html), které bych rád použil ve své administraci s více jazykovými mutacemi. Potřeboval bych tento kód trochu poupratit tak aby výchozí byla čeština (třeba #tab1), ale když překliknu na angličtinu, tak aby se mi všechna textová pole ve fomuláři na stránce přepla a zároveň zůstalo přepnutí i po odeslání dat do databáze dle url (třeba #tab2). Nikde jsem nenašel vícetabulkové řešní. Byl bych všem vděčný, kdyby mi s tím pomohli....
Html soubor:
=========
js soubor:Kód:<!-- This is the box that all of the tabs and contents of the tabs will reside --> <div id="tabs_container"> <!-- These are the tabs --> <ul class="tabs"> <li class="active"> <a href="#" rel="#tab_1_contents" class="tab">Tab 1</a> </li> <li><a href="#" rel="#tab_2_contents" class="tab">Tab 2</a></li> <li><a href="#" rel="#tab_3_contents" class="tab">Tab 3</a></li> </ul>
=======
Kód:// Load this script when page loads $(document).ready(function(){ // Set up a listener so that when anything with a class of 'tab' // is clicked, this function is run. $('.tab').click(function () { // Remove the 'active' class from the active tab. $('#tabs_container > .tabs > li.active') .removeClass('active'); // Add the 'active' class to the clicked tab. $(this).parent().addClass('active'); // Remove the 'tab_contents_active' class from the visible tab contents. $('#tabs_container > .tab_contents_container > div.tab_contents_active') .removeClass('tab_contents_active'); // Add the 'tab_contents_active' class to the associated tab contents. $(this.rel).addClass('tab_contents_active'); }); });


Odpověď s citací

