CMS Development

PKirova
Contributor

Tabs to According - Open on Second Tab on Pageload

SOLVE

Hi,

 

I implemented tabs to accordion module as described here: https://designers.hubspot.com/code-gallery/entry/founders/esparkbizhubspot-Tabs-to-Accordion-Module 

By default, it is opened on the first tab when the page is loaded. How can I change it to be opened by default on the second tab?

Here is my page: https://hs.scaleflex.com/media-uploader-widget-0?hs_preview=aAlgrHYD-64866951625 

 

I tried changing the html in line 5 to "loop index==2" but then it loads second 2 above with the content from tab 1 belowScreenshot 2023-03-31 at 10.23.01.png (see screenshot).

0 Upvotes
1 Accepted solution
PKirova
Solution
Contributor

Tabs to According - Open on Second Tab on Pageload

SOLVE

I found the solution, posting it here in case someone else needs to do this: 

In Html change line 5 to tab index==2

In JS file change line $(“.tab_content:first”)  to:

 $("ul.tabs li").eq(1).addClass("active").show(); //Activate second tab
   $(".tab_content").eq(1).show(); //Show second tab content

 

 

View solution in original post

0 Upvotes
1 Reply 1
PKirova
Solution
Contributor

Tabs to According - Open on Second Tab on Pageload

SOLVE

I found the solution, posting it here in case someone else needs to do this: 

In Html change line 5 to tab index==2

In JS file change line $(“.tab_content:first”)  to:

 $("ul.tabs li").eq(1).addClass("active").show(); //Activate second tab
   $(".tab_content").eq(1).show(); //Show second tab content

 

 

0 Upvotes