Hey there folks!
Thanks in advance for the wonderful assistance and guidance you're always willing to provide!
I have a tabbed layout scripted as such:
And the Javascript automating the selection of tabs:Code:<div id="tabbedBox1" class="tabbedBox"> <div class="tabbedArea"> <ul class="tabs"> <li><a id="tab_1" class="active" href="javascript:tabSwitch (1, 3, 'tab_', 'stuff_');">Tab 1</a></li> <li><a id="tab_2" href="javascript:tabSwitch (2, 3, 'tab_', 'stuff_');">Tab 2</a></li> <li><a id="tab_3" href="javascript:tabSwitch (3, 3, 'tab_', 'stuff_');">Tab 3</a></li> </ul> <div id="stuff_1" class="stuff"> One Tab. </div> <div id="stuff_2" class="stuff"> Two Tabs!! </div> <div id="stuff_3" class="stuff"> Four Tabs!!!! Wait... </div> </div> </div>
My issue is, when I attempt to link to—let's say—tab 2 using #tab_2 in the link and having another script select based on a search for the hash, it merely highlights the tab and doesn't make the content active/displayed.Code:<script type="text/javascript"> function tabSwitch(active, number, tab_prefix, stuff_prefix) { for (var i=1; i < number+1; i++) { document.getElementById(stuff_prefix+i).style.display='none'; document.getElementById(tab_prefix+i).className=''; } document.getElementById(stuff_prefix+active).style.display='block'; document.getElementById(tab_prefix+active).className='active'; }; </script> <script type="text/javascript">
If you'd like to see some of the options I've tried, I'd be happy to post it. Thanks again!!!
Sincerely,
A Bunch of Baby Ducks


Reply With Quote
Bookmarks