Help needed with JQuery and tabs

Discussion in 'jQuery' started by ghkgk, Aug 13, 2009.

  1. #1
    Hello,
    Well... there is a function which switches between the tabs on click and I suppose one of the tabs is chosen by default.

    $(document).ready(function() {
            var tabContainers = $('div.tabsdes > div');
            tabContainers.hide().filter(':first').show();
            $('div.navigation div.menu a').click(function () {
                    tabContainers.hide();
                    tabContainers.filter(this.hash).show();
                    $('div.navigation div.menu a').removeClass('selected');
                    $(this).addClass('selected');
                    return false;
            }).filter(':first').click();
    });
    
    
    Code (markup):
    That is the code from jquery.tabs.js. I see that here the first tab is chosen to open when the page is load - " tabContainers.hide().filter(':first').show();". However, I want to change it on a different tab, for example the third. When i change ":first" to ":third" it doesnt work... The fifth tab is activated where i load tha page.

    Can you please help me. Where I'm wrong?
     
    ghkgk, Aug 13, 2009 IP