PDA

View Full Version : Keep default content, when tab with no content is hovered over



bfider2k
03-24-2008, 03:26 AM
1) Script Title: DD Tab Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

3) Describe problem:

The "Forums" and "GIF Optimizer" tabs do not have any content to reveal when the user mouses over the tab, so it displays an empty, white-space.

Is there a way to leave the default content displayed, the "Home" tab in Example 1 for example, when one of these tabs is hovered over?

Thanks in advance for any tips!

codeexploiter
03-24-2008, 03:43 AM
You can do this by setting the same "rel" attribute that you've specified for the 'Home' item even for 'Forums' and 'Gif Optimizer' items. Check the following code copied from the demo page of the script:



<div id="ddtabs1" class="basictab">
<ul>
<li><a href="http://www.dynamicdrive.com" rel="sc1">Home</a></li>
<li><a href="http://www.dynamicdrive.com/new.htm" rel="sc2">DHTML</a></li>
<li><a href="http://www.dynamicdrive.com/style/" rel="sc3">CSS</a></li>
<li><a href="http://www.dynamicdrive.com/forums/">Forums</a></li>
<li><a href="http://tools.dynamicdrive.com/imageoptimizer/">Gif Optimizer</a></li>
</ul>
</div>


If you look at the 'Home' item you can see that its 'rel' attribute has a value of 'sc1' but there is no such attribute for 'Forums' and 'Gif Optimizer' items (rest of the items have that values). You can set a 'rel' attribute value for 'Forums' and 'Gif Optimizer' items like the following manner



<div id="ddtabs1" class="basictab">
<ul>
<li><a href="http://www.dynamicdrive.com" rel="sc1">Home</a></li>
<li><a href="http://www.dynamicdrive.com/new.htm" rel="sc2">DHTML</a></li>
<li><a href="http://www.dynamicdrive.com/style/" rel="sc3">CSS</a></li>
<li><a href="http://www.dynamicdrive.com/forums/" rel="sc1">Forums</a></li>
<li><a href="http://tools.dynamicdrive.com/imageoptimizer/" rel="sc1">Gif Optimizer</a></li>
</ul>
</div>

This will display the default value of the 'Home' item instead of an empty space.