Marris
08-08-2005, 11:59 PM
I am trying to add a mouseover effect (background color change) to each <td> cell in the navbar.
What I have done is define a new css class vbmenu_control_mover which is identical to vbmenu_control except for a different background color. Then I change the <td> class if onmouseover is detected on the cell.
This method works fine for all cells in the navbar with standard links, but the <td> onmouseover background change fails on the Search and Quick Links cells. Presumably this is because they have their own mouseover handling.
Is there any way to have mouseover on the Search and Quicklinks effect the entire containing <td> cell, rather than just the 'Search' text itself?
The only progress I have made was to move the id="navbar_search" from the <td> tag to the <a> tag. This allows the <td> background change over the cell, but only until the mouse reaches the link text...then the button reverts to the original background.
<td class="vbmenu_control" onmouseover="this.className='vbmenu_control_mover'" onmouseout="this.className='vbmenu_control'"><a id="navbar_search" href="$vboptions[bburl]/search.php?$session[sessionurl]" accesskey="4">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search",1); </script></td>
The attached image shows the mouseover effect on the cell (darker background), then the lower image shows the problem when the cursor is over the link text. The <td> background formatting is lost and the backgound color only changes under the text.
What I have done is define a new css class vbmenu_control_mover which is identical to vbmenu_control except for a different background color. Then I change the <td> class if onmouseover is detected on the cell.
This method works fine for all cells in the navbar with standard links, but the <td> onmouseover background change fails on the Search and Quick Links cells. Presumably this is because they have their own mouseover handling.
Is there any way to have mouseover on the Search and Quicklinks effect the entire containing <td> cell, rather than just the 'Search' text itself?
The only progress I have made was to move the id="navbar_search" from the <td> tag to the <a> tag. This allows the <td> background change over the cell, but only until the mouse reaches the link text...then the button reverts to the original background.
<td class="vbmenu_control" onmouseover="this.className='vbmenu_control_mover'" onmouseout="this.className='vbmenu_control'"><a id="navbar_search" href="$vboptions[bburl]/search.php?$session[sessionurl]" accesskey="4">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search",1); </script></td>
The attached image shows the mouseover effect on the cell (darker background), then the lower image shows the problem when the cursor is over the link text. The <td> background formatting is lost and the backgound color only changes under the text.