Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 5th, 2008, 10:52 AM
Registered User
 
Join Date: Sep 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get the position of the mouse

Hello everyone,

Is it possible for me to set the position of an element dynamically at the mousepointer? ie are there any css attributes like posX and posY which I can set to X-coordinate and Y-co ordinate of the mouse respectively without using javascript?

Thanks in advance.

 
Old November 5th, 2008, 10:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Nope.

--
http://yupapa.com
 
Old November 5th, 2008, 12:13 PM
Registered User
 
Join Date: Sep 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is it possible if I use javascript?

 
Old November 5th, 2008, 04:48 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Yes, although you have to check which browser is in use. The code from MSIE is different than for Mozilla-based browsers. Not sure about code for Apple's Safari. Probably Mozilla-compatible, but would need to be checked.

Lots of sites have help with this, so pointless to write code here for you.

You might start with the JavaScript FAQ section at http://www.irt.org
 
Old November 5th, 2008, 04:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Here's more.
http://google.com/search?q=JavaScript+mouse+position

--
http://yupapa.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
determine mouse click position amr_qura Struts 0 June 26th, 2007 03:40 PM
mouse position angelboy C# 2005 0 April 9th, 2007 04:07 PM
track mouse position while it's held down and move lina10 VBScript 0 April 9th, 2007 12:50 AM
Word-cursor position using mouse is not changing jahid Pro VB 6 2 February 6th, 2007 05:32 AM
Where's my mouse? Giant_robot_sandwich Javascript How-To 2 January 9th, 2007 09:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.