Skip to content Skip to sidebar Skip to footer

Access Specific Tab Through Url

I found a tab system in jQuery on the internet but the guy who made it (and authorized it's use) isn't available for contact anymore, so this is why I ask this question here. This

Solution 1:

document.location.hash returns the hash with the number sign (#hash). You also can't use .tabs ul li a as the selector because there is no a tag inside of the li.

Try using:

var hash = document.location.hash.substr(1); // skip 1 character (the number sign)
$('.tabs ul li[id^="' + hash + '"]').click();

Also, this script isn't in jQuery. It only uses 1 jQuery function throughout the whole script. I would consider this more pure JavaScript than jQuery.

Post a Comment for "Access Specific Tab Through Url"