How to dynamically set position for a component
I am trying to build this interface where there are icons and onmouseover, it displays menu choices for the corresponding. Instead of fixing the position of the menu box, is there a way to specify the left and top of that, relative to the icon that is being hovered? Here is part of my code:
- <table width="100%" style="">
- <tr align="center">
- <td>
- <img id="imgHead1" src="images/ccd.ico" alt="Info Center" style="position:relative; border:1px solid black;" />
-
- <img id="imgHead2" src="images/back_label.gif" alt="Reports" style="position:relative;" />
- </td>
- <td>
-
- </td>
- </tr>
- <tr align="center">
- <td>
- <div id="imgH1div1" style="width:200px; height:50px;margin: 0px 0 0 0px;
- border:1px solid gray; padding:20px; position:relative;left:98px;" >
- <a href="http://www.ccdsystems.com" ><img id="imgH1image1" src="images/B1.gif" alt="Create Event" /></a>
- <img id="imgH1image2" src="images/btnAdd.gif" alt="Remove Event" />
- </div>
-
- <div id="imgH2div1" style="width:200px; height:50px;margin: 0px 0 0 0px;
- border:1px solid gray; padding:20px;position:relative;left:170px;" >
- <img id="imgH2image1" src="images/Chart_Pie.gif" alt="Create Event" />
- <img id="imgH2image2" src="images/Close_Button.gif" alt="Create Event" />
- </div>
- </td>
- </tr>
- </table>
Thanks.