I have 3 tabs on this page http://fiftyallstars.com/tabs.html that I'm trying to target with 3 distinct direct links. Is it possible to have a script read an appended URL to remove/add the necessary active class to achieve the results I'm attempting to achieve. Any other suggestions would be great as well.

PS I'm not great at coding, but I'll try my hardest. Thanks!

Recommended Answers

All 2 Replies

I have another suggestion and that is using the HTML5 History API (pushState and AJAX) for this. This will also work with the browser back button and you don't get all this content in one document unlike your tab implementation.

Here's a little tut and example demo:

you can use the document.location.href to look up the url and then append the new class to the appropriate element
add distinct classes or ids to your tabs to make then easy to find

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.