• Resolved superclean

    (@superclean)


    Hello!

    I love this plugin! It’s amazing!

    I would like to know if there’s a way to pre select a tab upon load?
    lets say I have a tab named “specs” is there a way that tab can be pre selected upon loading the page? Maybe with Javascript?

    Thanks!
    -SuperClean ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • jpowersdev

    (@jpowersdev)

    Hey @superclean,

    Neat question. I’d probably do the following:

    
    window.onload = 
        () => document.querySelector("a[href='#tab-my-tab']").click()
    

    If your theme is more complicated, you may have to select the tab more specifically than what I’ve done. But ultimately, you need to click the anchor tag inside the tab <li>

    Let me know if that helps,
    Jon

    Thread Starter superclean

    (@superclean)

    @jpowersdev Your amazing!
    Your code worked perfectly! Thank you so much! I spent so much time with css and javascript trying to make it work lol.

    Now it’s perfect =)

    Thank you again!

    jpowersdev

    (@jpowersdev)

    Hey @superclean,

    Glad to hear it! You’re very welcome.

    Jon

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pre Select Tab on Load’ is closed to new replies.