...

View Full Version : change mouse icon on MouseOver() event



ajetrumpet
07-19-2009, 12:33 PM
all,

i have a simple div that has one line of text. the text is blue and underlined, so it looks like a link. i have an onclick() event for it to change element visibilities on my page. i would really like to change the mouse icon from an arrow to the hand pointer (the one you see when you hover over a hyperlink) when the mouse is over the div. i'm not sure if I need an API call for something like this or not. Hopefully there is a simpler way to do this than what i am doing. I tried experimenting with <a href> but i have no actual link to use, as i am not linking to anything. does anyone have any suggestions?

andrew1234
07-19-2009, 01:19 PM
Hi

Try this in your css.



a {
cursor:pointer:
}

is this what you wanted?

andrew1234
07-19-2009, 01:42 PM
this will work




#divname {
cursor:pointer:
}

abduraooft
07-19-2009, 01:48 PM
I tried experimenting with <a href> but i have no actual link to use, as i am not linking to anything. does anyone have any suggestions?

<div class="mydiv"></div>

div.mydiv:hover{
cursor:pointer;
}
(You may need to add some javascript hack for the lower versions of IE)

fside
07-19-2009, 04:34 PM
all,

i have a simple div that has one line of text. the text is blue and underlined, so it looks like a link.


But for some reason isn't an anchor element. I think abduraooft provided the best answer.

But if script were disabled, the text would still be there, but wouldn't have any reason to be? It wouldn't do anything? A lot of people use NoScript in Firefox. I use it all the time and initially see various new sites without any script at all. If it looks like it's needed, or I know that it is, I'll enable it.

I would think that it could be an anchor with whatever href, since href will never be used. Or it could be a INPUT element styled so that it doesn't look like a button. And you'd add this using Javascript, when the script first loads. And you'd add the event handlers using Javascript. If Javascript is disabled, nothing is there. Turn it on, the page reloads, your link shows up.

ajetrumpet
07-19-2009, 09:00 PM
this will work




#divname {
cursor:pointer:
}thank you so much andrew. i apologize for it being so simple. i love the intellisense in dreamweaver, but i am not a java programmer, nor do i know HTML. i am a VB person. that worked a treat. once again, thank you so much....i appreciate it. :)

andrew1234
07-19-2009, 09:06 PM
my pleasure



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum