views:

147

answers:

2

Hi, I add a div tag and append it to the body and then i add to add items to the div so that it becomes a popup menu. After appending the to body, is there a way to move the div tag. Actually what i want to do is that i want the div to appear wherever the mouse was clicked on the webpage. By the way i am developing a firefox extension. I need some help on this.

A: 

This quirksmode article is a great start when looking for help with mouse (x,y) coordinates.

Once you compute the coordinates, you can then use that information to position the div element on the page using css.

Mike Mytkowski
Thanks that was quite helpful
fftoolbar
A: 

You want to use the position:absolute style, along with left: and top:.

Moishe