It's a quick ad-hoc solution to allow you to link to your page to a specific tab from elementor tabs widget.
Here's the catch, you need to replace the id of the specific tab you want to use to not contain the title-
part.
Use
https://your-website/#elementor-tab-1515
instead of:
https://your-website/#elementor-tab-title-1515
Make sure you add the JavaScript code in the footer, so it loads after the elementor tabs widget, otherwise the elementor tabs widget code will override what we're trying to acheive.
Hi all,
I came across this while looking for a solution to link to Tabs. While none of the above worked for me, it did help push me in the right direction. Click() wasn't working.
My assumption - Recently Elementor released the new update which allows Tabs to include containers, flexbox, nested etc etc. I can only assume this update and changes may be the reason.
The following code works however needs a little tidying up, but hopefully helps someone.
Happy to receive feedback, if anyone can improve or sees issues.
The first part; reset variables, sets 'change' (false = no change, true = change), gets the hash, strips # from hash. Then converts url friendly tab_name to tab div ids (there are 3 divs to hide and 3 to show - 2 relate to the tab buttons and 4 for the content areas).
Note: you'll need to use div tools to inspect and get the ids relative to the tab widget you're working with. This example, 1962 (part of id) & 984da58 (data-id) are the ids for the second tab, 1963 is the 3rd tab.
`
`
Second part; selects 4 of the divs by id and 2 by data-id, and then changes the class and attr.
Note: 1961 (part of id) and e973369 (data-id) are the ids for the FIRST tab, the normal one that's visible first and needs to change from/hide.
`
`
Wrap the whole thing in a doc ready, tuck it in the footer; the above has a timeout like @Artem66 code.