Onclick and onmouseover conflicts?

B

bzi999

Hi!
I'm having a strange problem with javascript and maybe someone herecan
help me.
Look at this simple html snippet:

<div id="menu">
<img src="images/m1.gif" usemap='#map' border=0>
<MAP name="map">
<AREA HREF="link1.htm" COORDS="26,0,66,14"
onMouseOver="showit('option 1')" onMouseOut="showit('')">
<AREA HREF="link2.htm" COORDS="82,0,154,14"
onclick="alert('click')" onMouseOver="showit('option 2')"
onMouseOut="showit('')"></MAP>
</div>

(Showit() is a simple function that outputs some text) Everything
worked ok until I've added the onmouseover events. Since then the mouse
clicks stopped working - the links and the alert never open. Strangely
enough, there's no conflicts with the onmouseout. This is driving me
craaaaaaazy...

Any ideas about this problem? Maybe this is a know JS bug or something?
Thanks for any help you can dispense with this tormented soul.
 
A

ASM

<img src="images/m1.gif" usemap='#map' border=0>
<MAP name="map">
<AREA HREF="link1.htm" COORDS="26,0,66,14"
onMouseOver="showit('option 1')" onMouseOut="showit('')">

try (no capital) :
onmouseover="showit('option 1'); this.focus();" onmouseout="showit('')">
sans garantie ...

and if it is only for a small bulb-info, try :
(Showit() is a simple function that outputs some text)

output ? what way ? (div ? JS alert ? ... )
 
B

bzi999

Thanks for the help. Unfortunately the focus() didn't worked. Good idea
though :)
output ? what way ? (div ? JS alert ? ... )

Is just does a innerHTML write of a <div> block in another part of the
page (explaining the action for every button the cursor passes by).
 
A

ASM

Is just does a innerHTML write of a <div> block in another part of the
page (explaining the action for every button the cursor passes by).

OK,

tested with my FF and my IE

all is OK and works fine with your code !

do your pages exist ?
do you have a targetting to blank somewhere ?
 
R

Randy Webb

ASM said the following on 8/16/2005 10:24 AM:
try (no capital) :

FWIW, on.. event handlers are not case sensitive in HTML. ONMOUSEOVER
and onmouseover are the exact same to the JS engine. The only purpose of
camelHumpNotation is readability by humans, the computer doesn't care.

If you start with this simple code in a sample HTML page:

<A HrEf="someWhere.html" onMOUSEover = "alert()"
onmOUseOuT="alert()">TEst Link</a>

And then, where supported, run this in the Address Bar:

javascript:'<code><ol><li>'+(document.documentElement||document.body).outerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/%20%20/g,"&nbsp;%20").replace(/(\n\r?|\r)/g,"<li>")+'<\/ol><\/code>';

You will see that IE converts it all to lower case anyway in it's
internal representation (called "Normalized Code")
 
A

ASM

Randy said:
ASM said the following on 8/16/2005 10:24 AM:


FWIW, on.. event handlers are not case sensitive in HTML.

did he say he is allways working in HTML ?

anyway ... I told it between ( )
You will see that IE converts it all to lower case anyway in it's
internal representation (called "Normalized Code")

IE ? why IE ? what IE ?

I did try ... and it has worked ... yes yes

funny : I tape all my css in lower case and ...
IE displayes :
H1 {COLOR: red; FONT-SIZE: 22px
 
B

bzi999

Ops... solved the problem. It had to do with another script that
"stole" the focus <blush> Thanks you guys anyway for the fast reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top