masantha wee wrote-
Hi all,
I am using Firefox and embedding Javascript in html. I understand that
we can use mouse events by coding them in the body of html (by creating
a button or anything and by adding in the events in the <img> tag).
[code]
<input id="StdDev Value" name="StdDevBut ton" type="button"
value="Standard Deviation Value" onclick="readSt dDevValue()"/>
But what if I need to add some mouse events without creating any img or
button? What I mean is - when the mouse cursor is in certain
coordinates
(eg. in certain areas on an image), then if the user left click,
something will happen. The beloow example code seems to be not working
for me....
....
Could anyone tell me how could I do it, please?
Thanks in advance.
seanky
well, there is a way to acomplish this using the <map> tag.
<HTML>
....
<IMG height=208 src="someImageS ource.jpg" width=241
useMap=#newspla sh border=0>
<MAP name=newsplash>
<AREA
onClick="window .alert('Working !!!')"
shape=POLY target=_top
coords=1,2,1,46 ,78,48,80,197,2 40,201,239,18,9 3,12,94,2 <!--
example of coords -->
<AREA
onClick="window .alert('Working !!!')"
shape=RECT target=_top
coords=someCoor ds
<AREA
onClick="window .alert('Working !!!')"
shape=RECT target=_top
coords=someCoor ds
<AREA
onClick="window .alert('Working ')"
shape=RECT target=_top
coords=someCoor ds
</MAP>
</BODY>
</HTML>
Maybe this will help, I hope it does. This should work, but I a no
javascript expert.
(____)
(\/)
/-------\/
/ | MWH ||
- ||----||