HighDots Forums  

Body OnClick event... detect name/id of element clicked on?

alt.html alt.html


Discuss Body OnClick event... detect name/id of element clicked on? in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Noozer
 
Posts: n/a

Default Body OnClick event... detect name/id of element clicked on? - 09-04-2005 , 05:01 AM






Is it possible to detect where on a page the click occurred when the OnClick
event of the BODY tag is fired?

Thx



Reply With Quote
  #2  
Old   
Neredbojias
 
Posts: n/a

Default Re: Body OnClick event... detect name/id of element clicked on? - 09-04-2005 , 05:54 AM






With neither quill nor qualm, Noozer quothed:

Quote:
Is it possible to detect where on a page the click occurred when the OnClick
event of the BODY tag is fired?
Yes, at least in IE. Horizontal: event.clientX - Vertical:
event.clientY.

--
Neredbojias
Contrary to popular belief, it is believable.


Reply With Quote
  #3  
Old   
Noozer
 
Posts: n/a

Default Re: Body OnClick event... detect name/id of element clicked on? - 09-05-2005 , 12:32 AM




"Toby Inkster" <usenet200509 (AT) tobyinkster (DOT) co.uk> wrote

Quote:
Noozer wrote:

Is it possible to detect where on a page the click occurred when the
OnClick event of the BODY tag is fired?

Yes, but it's bloody tricky.

"Mission Impossible - mouse position" by Peter-Paul Koch.
http://www.evolt.org/article/Mission...tion/17/23335/
Ick... that doesn't look very friendly at all.

.... so any idea if it's possible to detect where in a document a click
occurs (ie, within which element, or span or div, etc?)

Thx




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.