what is wrong with my jquery tabber code?

Odothethads

New Member
Somebody please save me!! I'm so frustrated don't know what I'm doing wrong. What is wrong with my code?? it activates a particular tab based on the URL. for example \[code\]www.mywebsite.com#tab3\[/code\] will activate tab3 of my tabber and this is how I'm achiving this, I use \[code\]location.hash\[/code\] to get the location and compare with href then activate that tab. But here lies the problem. I've 2 differently styled tabs (\[code\]ul#tabs li a\[/code\] and \[code\]ul.tabs li a\[/code\]). Am I selecting and doing the comaparisom well?. This is the code:-\[code\] var hash = location.hash; $(".tab_content").hide(); //Hide all content if ($("ul#tabs li a[href='" + hash + "'], ul.tabs li a[href='" + hash + "']").length) { $("ul#tabs li a[href='" + hash + "'], ul.tabs li a[href='" + hash + "']").parent().addClass("active"); //Activate tab $(hash).show(); }\[/code\]
 
Back
Top