Hey All!
I am using “toggle hash” on the tabs, and it works perfectly on chrome, mobile, and edge… however when I try to use it on firefox it doesn’t load the appropriate tab. Is this something that is happening for others?
Thanks!
Hey All!
I am using “toggle hash” on the tabs, and it works perfectly on chrome, mobile, and edge… however when I try to use it on firefox it doesn’t load the appropriate tab. Is this something that is happening for others?
Thanks!
Hey Everyone,
I’m not sure if this is the perfect fix or if maybe I setup something incorrectly, but the solution for me was to add this bit of code which I wrote to double check the hash and activate the tab if a hash exists.
jQuery(document).ready(function() {
if(window.location.hash) { //if hash exists
var hash = window.location.hash.substring(1); //save hash to var and subtract #
var toggle = jQuery('.x-tabs-list [data-x-toggle-hash="' + hash + '"]').attr('data-x-toggleable'); //save toggleable value of hash
if (toggle != null && !jQuery('.x-tabs-panels [data-x-toggleable="' + toggle + '"]').hasClass('x-active')) { //if the toggleable value exists and isn't the current active hash
jQuery('.x-tabs-list .x-active').removeClass('x-active'); //remove active tab button class
jQuery('.x-tabs-panels .x-active').removeClass('x-active'); //remove active tab panel class
jQuery('.x-tabs-list [data-x-toggleable="' + toggle + '"]').addClass('x-active');//activate hashed tab button
jQuery('.x-tabs-panels [data-x-toggleable="' + toggle + '"]').addClass('x-active'); //activate hashed tab panel
}
}
});
Great that the solution works for you, and thanks for sharing it for helping others.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.