Link to home
Start Free TrialLog in
Avatar of kingsfan76
kingsfan76

asked on

capture mouse coordinate to reposition a <div>

I want to be able to reposition a <div> based on the mouse coordinate when it's clicked:
------------------------------------

function repositionDiv()
{
   //???????????
}

<table>
  <tr onClick="repostionDiv()">
     <td>Row 1</td>
   </tr>
   <tr onClick="repostionDiv()">
     <td>Row 2</td>
   </tr>
</table>

<div id=myDiv style="width:300;height:100" style="display:none">
  <table bgColor=white width=280>
    <tr>
       <td>This is the div i want to display when Row 1 or Row 2 is clicked</td>
    </tr>
  </table>
</div>
--------------------

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial