473,758 Members | 2,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Onclick and onmouseover conflicts?

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="sh owit('option 1')" onMouseOut="sho wit('')">
<AREA HREF="link2.htm " COORDS="82,0,15 4,14"
onclick="alert( 'click')" onMouseOver="sh owit('option 2')"
onMouseOut="sho wit('')"></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.

Aug 16 '05 #1
6 3309
ASM
bz****@gmail.co m wrote:

<img src="images/m1.gif" usemap='#map' border=0>
<MAP name="map">
<AREA HREF="link1.htm " COORDS="26,0,66 ,14"
onMouseOver="sh owit('option 1')" onMouseOut="sho wit('')">
try (no capital) :
onmouseover="sh owit('option 1'); this.focus();" onmouseout="sho wit('')">
sans garantie ...

and if it is only for a small bulb-info, try :
<AREA HREF="link1.htm " COORDS="26,0,66 ,14" title="text of option 1">
(Showit() is a simple function that outputs some text)


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

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #2
Thanks for the help. Unfortunately the focus() didn't worked. Good idea
though :)
(Showit() is a simple function that outputs some text)

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).

Aug 16 '05 #3
ASM
bz****@gmail.co m wrote:
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).


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 ?

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #4
ASM said the following on 8/16/2005 10:24 AM:
bz****@gmail.co m wrote:

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

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
camelHumpNotati on 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="ale rt()">TEst Link</a>

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

javascript:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer HTML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%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")

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 16 '05 #5
ASM
Randy Webb wrote:
ASM said the following on 8/16/2005 10:24 AM:
onMouseOver="sh owit('option 1')" onMouseOut="sho wit('')">
try (no capital) :


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

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #6
Ops... solved the problem. It had to do with another script that
"stole" the focus <blush> Thanks you guys anyway for the fast reply.

Aug 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9175
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
2
4090
by: WindAndWaves | last post by:
Hi Folk I have an image map (map of New Zealand with various areas defined using an image map). Now I am wondering if it is possible to link this "image map" to an onclick and onmouseover event. Any ideas? - TIA
6
9942
by: Cockroach | last post by:
Hello, I have a problem where the onClick of a table row will activates a window.location event, and inside a cell in that row, an image onClick event shows/hides a div. The problem is that when you click on the image, it briefly shows the div, and then reloads the page to the window.location url. Is there a way of preventing the onClick of the row (<tr>) from doing
2
2264
by: karunakar | last post by:
Hi All In datagrid OnMouseOver iam showing some color Onmouseout also working fine . Here my problem is when ever click the pariculat row in DataGrid iam showing red color that time i am not getting any problem . when ever mouse was changed paricular row that time color is lossed "When ever click the particular Row That time i want to show that color & that time dont loss that color( when ever onMouseover changed)" Here it's not...
2
8058
by: Peter | last post by:
Hi, this is the code, and new row and new cell generated ok, but why the onclick and onmouseover doen't work? Thank you in advance! <html> <head> <script language="javascript"> function inserttable() {
4
19560
by: Amy | last post by:
I need some help. I have this table with alternate row colors. Class gray and class white. I have javascript that do highlight when mouseover row ... and onclick to select row and highlight it with another color. Also created a class called "Selected". You can only select a row at a time. My problem is, if a row is preselected, when mouseover the selected row, the selected color is screwed. Until you click on the selected row once, the...
6
4897
by: Marko Mikkonen | last post by:
I'm trying to make code which does something when user clicks a row in a table. I tried a javascript code from JS-Examples.com. It works on Firefox, but not on Internet explorer 7. Here's the code: <html> <head> <!-- This file retrieved from the JS-Examples archives http://www.js-examples.com 1000s of free ready to use scripts, tutorials, forums.
4
2206
by: since | last post by:
How do I in IE prevent the onclick action from being fired when I am done dragging? have tried "window.event.cancelBubble = true", for onmouseup , onmousedown, and onmousemove handlers. The onclick sort action always seems to get fired. Any help would be greatly appeciated. The following demo is sortable and resizable. I basically don't want the onclick action to be fired if I am resizing a column. Steve <HTML> <HEAD> <style>
18
7777
by: wizdom | last post by:
Help - change text on click - text has another onclick inside with php variables ---------- I think what I'm trying to do is simple. I have a 2 buttons on a page. 1 button allows a thread of messages to be displayed, the other button collapses that same thread. Works fine. I was asked if I can just make it one button. I've played around with a few java scripts. they seem to all work fine until i put my added codes in the text line...
0
9299
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10076
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9908
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9740
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7287
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3402
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2702
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.