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
https://forums.phpfreaks.com/topic/108981-solved-onclick-event-in-firefox/
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> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.