AJAX Forums

JavaScript to reposition a message DIV element on mouse click?

This is a discussion on JavaScript to reposition a message DIV element on mouse click? within the JavaScript forums, part of the Beginners AJAX category; JavaScript to dynamically reposition, a message in a DIV element to the current position of the mouse cursor, anywhere within the Body of the document in the event of a ...


Go Back   AJAX Forums > Beginners AJAX > JavaScript

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Old 05-24-2007, 09:37 AM   #1 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 1
Rep Power: 0 siggy_2003 is on a distinguished road
JavaScript to reposition a message DIV element on mouse click?

JavaScript to dynamically reposition, a message in a DIV element to the current position of the mouse cursor, anywhere within the Body of the document in the event of a mouse click?
__________________
siggy_2003 is offline   Reply With Quote
Old 05-24-2007, 11:53 AM   #2 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 1
Rep Power: 0 polly_peptide is on a distinguished road
Then you write your "body_onclick()" function to handle whatever it is you want to display.
__________________
polly_peptide is offline   Reply With Quote
Old 05-24-2007, 06:11 PM   #3 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 1
Rep Power: 0 Math Guy is on a distinguished road
Try the following. The body tab responds to the onclick event and calls a function that sets the top and left properties of the style of the divthis is the textfunction doit(event){bleck.style.left=event.clientXbleck.st yle.top=event.clientYalert("X coords: " + x + ", Y coords: " + y)}
__________________
Math Guy is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
XML Parsing Error: no element found macnux XML and XSLT 0 01-14-2008 06:03 AM
what position element should i use? xhtml/html/css? Just Believe XHTML and CSS 1 10-27-2007 12:16 PM
I want to disable mouse middle scroll button's click event.. using javascript? Ahsan B JavaScript 0 06-22-2007 02:35 PM
Please let me know the steps for getting rid of an error message"JavaScript not Shinde VamshiDhar JavaScript 3 06-17-2007 10:21 PM
What are the name and ID of a HTML element? delta man XHTML and CSS 2 04-25-2007 01:56 PM


All times are GMT -4. The time now is 08:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com