[Typo3] link on <td> in tmenu_layers

JoH info at cybercraft.de
Wed Jun 29 18:53:03 CEST 2005


> All menuitems are aligned top to bottom in a table. Each cell has a
> white background and should change the background on mouseover:
> wrap = <tr><td class="tdout" onmouseover="this.className='tdover;"
> onmouseout="this.className='tdout'">|</td></tr>

You don't need any JS here for the color, just pure CSS.

> That's the effect I want, but now the user might get the idea that
> wherever there is mouse interaction (over+out) he's in an active
> region and tries to klick...
> Obviously the link is only on the text thus letting the menu disappear
> without calling the link.

You should not use the table cell to give you a backgroud color it should be
done in the A-Tag. Just make the A-Tag a block element and you're done.
The JS will still trigger the visibility of the layers but not the color.

<td class="menu"><a href="whatever">This is my link</a></td>

and in the CSS file:

td.menu a {
    display:block;
    width:200px;
    height:30px;
    line-height:30px;
    vertical-align:middle;
    background: #f00;
    color: #ff0:
}

td.menu a:hover {
    background: #0f0;
    color: #0ff;
}

That's it ...
And BTW: Since we are using an A-tag with hover here, it is working fine in
IE too.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau






More information about the TYPO3-english mailing list