I need to have a hidden div and show it where ever I click on a page. Do I make its position relative? How do i associate with a position of a click?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you know jQuery, then you can do a simple
css({left:e.pageX, top:e.pageY})in replacement for this sample (click anywhere and you’ll get the position):http://jsbin.com/ufovo3
Here’s the code:
http://jsbin.com/ufovo3/edit
Here’s a better demo:
http://jsbin.com/ufovo3/2/
source
http://jsbin.com/ufovo3/2/edit
Click it and watch it move where you click.