samsono / Easy-Responsive-Tabs-to-Accordion

Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices like: web, tablets, Mobile (IPad & IPhone). This plugin adapts the screen size and changes its action accordingly.
Other
603 stars 259 forks source link

Set Default Tab #20

Closed Reem-Alatrash closed 9 years ago

Reem-Alatrash commented 10 years ago

I have a tabs that are dynamically loaded and I want to set one of them as the default one.

I added class="resp-tab-active" to the list item to be opened by default. However, this didn't work. I tried putting the item at the beginning of the list which works only if there are more than 1 items in the list.

seyyed-sina commented 9 years ago

the same issue here any solution??

seyyed-sina commented 9 years ago

i solved it by adding this line after calling script:

$('h2[aria-controls="tab_item-1"]').click();

u can change it to every tab u want :-)

vimaltechvistara commented 7 years ago

First Close All Active Tabes:

$("ul.resp-tabs-list > li").removeClass("resp-tab-active"); 
$("div.resp-tabs-container > h2").removeClass("resp-tab-active"); 
$("div.resp-tabs-container > div").removeClass("resp-tab-content-active");
$("div.resp-tabs-container > div").hide();

Open Tab Item 2:

$('ul.resp-tabs-list > li[aria-controls="tab_item-2"]').addClass("resp-tab-active"); 
$('div.resp-tabs-container > h2[aria-controls="tab_item-2"]').addClass("resp-tab-active"); 
$('div.resp-tabs-container > div[aria-labelledby="tab_item-2"]').addClass("resp-tab-content-active");
$('div.resp-tabs-container > div[aria-labelledby="tab_item-2"]').show();