Daniel_Paris
(Daniel Garcia Paris)
1
memetican
(Michael Wells)
2
Hey Daniel, you shared your preview link twice, what is the post you are referencing?
Daniel_Paris
(Daniel Garcia Paris)
3
Sorry about that. I was referring to the tabs on this image
memetican
(Michael Wells)
4
Ah, but you mentioned a forum post that you’re trying to implement?
That link is missing.
Daniel_Paris
(Daniel Garcia Paris)
5
Sorry, again. Here is the link:
There are a few more posts with the same code on the forum. But I use this one as a reference.
memetican
(Michael Wells)
6
Ah that solution isn’t designed to handle URL encoding, and your tab names have spaces, which is why you see #Tab%202
in your querystring.
You can compensate for that in your changeTab function;
function changeTab() {
var tabName = window.location.hash.substr(1);
// Fix encoded spaces
tabName = tabName.replace(/%20/g, ' ');
var tabEl = $('[data-w-tab="' + tabName + '"]');
console.log(tabEl)
if (tabEl.length) {
tabEl.click();
}
}
Daniel_Paris
(Daniel Garcia Paris)
7
That worked perfectly!!!
Many thanks
1 Like