Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts

    change mouse icon on MouseOver() event

    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?

  • #2
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Hi

    Try this in your css.


    Code:
    a {
    	cursor:pointer:	
    }
    is this what you wanted?

  • Users who have thanked andrew1234 for this post:

    ajetrumpet (07-19-2009)

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts
    this will work



    Code:
    #divname {
    	cursor:pointer:	
    }

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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?
    Code:
    <div class="mydiv"></div>
    Code:
    div.mydiv:hover{
    cursor:pointer;
    }
    (You may need to add some javascript hack for the lower versions of IE)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Quote Originally Posted by ajetrumpet View Post
    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.

  • #6
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by andrew1234 View Post
    this will work



    Code:
    #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.

  • #7
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts
    my pleasure


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •