Jump to content

[SOLVED] onClick event in Firefox


saint959

Recommended Posts

Hey Guys,

 

From what i can see many people have had similiar problems as i am having. I consider myself a complete noob to javascrpt and am having serious problems with the below.

 

basically, its a image that i have mapped with different co-ordinates, what i want is when a user clicks on a section of the image a function must execute.

 

The below works perfectly in IE and Opera but i cant get it to work in Firefox.

 

imagecode

     <img src="images/colorWheel.jpg" width="241" height="237" border="0" usemap="#Map" onMouseover="this.style.cursor='pointer'"/>

 

then here is one of the area's code within the image


<map name="Map" id="Map">
  <area shape="poly" coords="149,79,185,35,204,53,160,89" onClick="colorShow('#ff8000')" />
</map>

 

i have removed many of the shapes as they all pretty much do the same thing. the function colorShow() is not being executed at all in firefox.

 

please help :)

 

 

 

 

Link to comment
Share on other sites

Hi, nevermind, i finally found my problem.

 

the external js file i was using was being defined like this:

 


<script type="text/jscript" src="includes/colorWheelAllocate.js"></script> 

 

So i changed it to teh below and its working perfectly now :)

 


<script type="text/javascript" src="includes/colorWheelAllocate.js"></script> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.