javascript onclick with hand cursor? Should be easy?

hello, I have an image map that changes based on where the user clicks. It is done using javascript and works great. However I can not get the cursor hand to display over the map area. I am not using a normal Href in the image map I am using a onclick event to swap the image and the image map name.  Below you can see i tied to add a OnMouseOver event but still no luck.


I have my css up top.
<style type="text/css">
<!--
.cursor {  cursor: hand}
-->
</style>


Here is the map.
<map name="world">
    <area shape="polygon" coords="29, 44, 18, 126, 33" onclick="javascript:wm(1);return false;" OnMouseOver="this.className='cursor';">
</map>

Here is the image with the map.
<img border="0" src="images/worldmap.gif" name="Map" useMap="#world">

I cant get the cursor to show. I know it should be easy... any ideas? Thanks in advance
SmeegelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FenomenOCommented:
Hi,just try these it works fine on IE:


onMouseOver="this.style.cursor='hand'"

so your html tag will be:

   <area shape="polygon" coords="29, 44, 18, 126, 33" onclick="javascript:wm(1);return false;" onMouseOver="this.style.cursor='hand'">


Let me know.


FenomenO
0
SmeegelAuthor Commented:
Nope, same thing nothing happens on mouseover. strangeness.... arg
0
FenomenOCommented:
try to put it before the OnClick:

<area shape="polygon" coords="29, 44, 18, 126, 33" onMouseOver="this.style.cursor='hand'" onclick="javascript:wm(1);return false;">

which browser are you using?????

FenomenO
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

FenomenOCommented:
Alternatively put it on the image tag:


<img border="0" src="images/worldmap.gif" name="Map" useMap="#world" onMouseOver="this.style.cursor='hand'">

FenomenO
0
FenomenOCommented:
Alternatively put it on the image tag:


<img border="0" src="images/worldmap.gif" name="Map" useMap="#world" onMouseOver="this.style.cursor='hand'">

FenomenO
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SmeegelAuthor Commented:
Hey figured it out, all i needed to add was a href = "#"

<area href ="#"shape="polygon" coords="29, 44, 18, 126, 33" onclick="javascript:wm(1);return false;">

Thanks
0
SmeegelAuthor Commented:
thanks for the help though. :) i'll award you the point.
0
SmeegelAuthor Commented:
Great response time, Thanks
0
vthoangCommented:
funny thing about image map, they don't like styles too much.
try:
<map name="world">
   <area href="somefunnytext" onclick="javascript:wm(1);return false;" style="cursor:hand" shape="poly" coords="29, 44, 18, 126, 33">
</map>

or even

<map name="world">
   <area href="javascript:wm(1);return false;" style="cursor:hand" shape="poly" coords="29, 44, 18, 126, 33">
</map>

although i'd put my return false in the wm() function to clean it up a little..
0
FenomenOCommented:
Glad to be helpful!!!
FenomenO
0
vthoangCommented:
<map name="world">
  <area href="javascript:wm(1);return false;"  shape="poly" coords="29, 44, 18, 126, 33">
</map>

typo...
you can leave out
style="cursor:hand"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.