[Typo3] link on <td> in tmenu_layers

Christopher bedlamhotel at gmail.com
Wed Jun 29 18:56:10 CEST 2005


On 29/06/05, Jochen Stange <derstange at gmx.de> wrote:
> Hi NG.
> I'm trying to achive a mouseover effect for a tmenu_layers object:
> 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>
> 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.
> My idea is to do something like: <td class="tdout" ....
> onClick="LinkFunction(ID)"> so I can set the link in JS. Therefore I'd need
> the current ID that goes into the link. => How do I read the current ID from
> a tmenuItem?
> Is there another way to do this? (I used a gmenu before, but the
> textrendering was bad ...)

Abandon ye the the complex ways of complexity and javascript use ye
not except where it is truly needed! For lo, a new technology hath
emergeth, and the name of that technology is CSS ;^)

Seriously, what you're doing can be easily done by applying the style
'display:block;' to the links in your menu (and possibly by adjusting
the height or line-height of the links so that they fill the entire
height of the table cell). 'display:block;' will make the clickable
area of the link occupy the whole area of the table cell it resides


More information about the TYPO3-english mailing list