Preselect Tab
Permalink
Hi
I have added tabs to a single_page using this code.
This works great.
What I now need, es a way to set the second tab active on page load.
Any ideas?
thanks
I have added tabs to a single_page using this code.
<script type="text/javascript"> $(document).ready(function(){ $('#tabset a').click(function(ev){ var tab_to_show = $(this).attr('href'); $('#tabset li'). removeClass('ccm-nav-active'). find('a'). each(function(ix, elem){ var tab_to_hide = $(elem).attr('href'); $(tab_to_hide).hide(); }); $(tab_to_show).show(); $(this).parent('li').addClass('ccm-nav-active'); return false; }).first().click();
Viewing 15 lines of 31 lines. View entire code block.
This works great.
What I now need, es a way to set the second tab active on page load.
Any ideas?
thanks
Raise a click event on the tab you want to activate
In this case you are raising event in the first one... so delete it and click on the second