Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Displaying a DIV wherever the mouse location is
Santosh Ramachandrula
Ranch Hand
Posts: 252
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, I am trying to do the above and I did some google but they seem to be tied to a mouse EVENT.
I want to be able to display the DIV wherever the mouse is without a Mouse Event. Can I do this? If yes how else any suggestions?
Thanks,
Santosh
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
No. Without an event, there is no way to run any code.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Santosh Ramachandrula
Ranch Hand
Posts: 252
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Ok.
I have a page where the user has
1. Scrolled down.
2. Performed an action.
3. Now I want to show a DIV containing Success/failure message at the center of the page relative to the current location.
How would I accomplish Step 3?
Thanks,
Santosh
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
In response to what? A mouse click?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Santosh Ramachandrula
Ranch Hand
Posts: 252
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Bear, I figured it out and Yes, in response to mouse click.
Thanks,
Santosh
Eric Pascarello
author
Posts: 15385
6
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
in case this shows up in a search, basic idea
function getXYPos(e){ e = e || window.event; var x = e.pageX || (e.clientX+(document.documentElement.scrollLeft || document.body.scrollLeft)); var y = e.pageY || (e.clientY+(document.documentElement.scrollTop || document.body.scrollTop)); alert(x + "," + y); } document.onclick = getXYPos;
Eric
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
onreadystatechange for div tag
Jpanels and Jscrollpanels
Href in a div, i want to action on the whole div ?
onmouseup X,Y coordinates
Positioning DIVs
More...