Am using jquery and tabs based on http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery/
<script type="text/javascript">
$(function() {
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
//On Click Event
$("ul#menu li").click(function() {
$("ul#menu li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
});
</script>
Is it possible to adjust this so that depending on the value in the URL (page.html#tab4 etc), the corrosponding tab will show?
I believe in its current state it doesn't work because it returns false, and that
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
is looking for an anchor value, rather than the URL.
Hope this makes sense.
I (think) if a fix is possible, I need a way to get the #tab from the URL as well as based on the Anchor clicked.
Thanks