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 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2010
    Posts
    32
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question onMouseOver not working in IE or Safari

    Hello! I need a bit of help here, if possible.

    This code seems to work well with FireFox. It doesn't work so well with IE or Safari though. The onMouseOver event works properly (changes the bg-color and the bg-image) but the onMouseOut event doesn't work (it changes the bg-color back to normal but not the bg-image).

    I don't quite understand the problem.


    Code:
    <table cellspacing="0" cellpadding="0" width="230" height="20">
    <tr>
    <td class="font1" align="center" style="color:#2a78c6; background-color: #3c3c3c; background-image:url('images/nav-bg.png')" onclick="window.location.href='#'" cursor: pointer;
    onMouseOver="this.style.color='c8c8c8'; this.style.backgroundColor='#2a78c6'; this.style.backgroundImage='url(images/nav-bg-hover.png)'"
    onMouseOut="this.style.color='#2a78c6'; this.style.backgroundColor='#3c3c3c'; this.style.backgroundImage='url(images/nav-bg.png'">
    LINK
    </td>
    </tr>
    </table>
    Here is the website... http://pmportfolio.net/tester/.

    Also can't figure out how to get that drop-down menu working for IE, if anyone can lend a hand.
    Also can't get the gradients to work with IE 8.
    Last edited by jimmyd; 12-19-2010 at 05:16 PM. Reason: Added more content.

  • #2
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    Quote Originally Posted by jimmyd View Post
    Hello! I need a bit of help here, if possible.

    This code seems to work well with FireFox. It doesn't work so well with IE or Safari though. The onMouseOver event works properly (changes the bg-color and the bg-image) but the onMouseOut event doesn't work (it changes the bg-color back to normal but not the bg-image).

    I don't quite understand the problem.


    Code:
    <table cellspacing="0" cellpadding="0" width="230" height="20">
    <tr>
    <td class="font1" align="center" style="color:#2a78c6; background-color: #3c3c3c; background-image:url('images/nav-bg.png')" onclick="window.location.href='#'" cursor: pointer;
    onMouseOver="this.style.color='c8c8c8'; this.style.backgroundColor='#2a78c6'; this.style.backgroundImage='url(images/nav-bg-hover.png)'"
    onMouseOut="this.style.color='#2a78c6'; this.style.backgroundColor='#3c3c3c'; this.style.backgroundImage='url(images/nav-bg.png'">
    LINK
    </td>
    </tr>
    </table>
    Here is the website... http://pmportfolio.net/tester/.

    Also can't figure out how to get that drop-down menu working for IE, if anyone can lend a hand. I'm new to that sorta thing.
    Add the end ) to the url background image your missing the end )

    Code:
    <table cellspacing="0" cellpadding="0" width="230" height="20">
    <tr>
    <td class="font1" align="center" style="color:#2a78c6; background-color: #3c3c3c; background-image:url('images/nav-bg.png')" onclick="window.location.href='#'" cursor: pointer;
    onMouseOver="this.style.color='c8c8c8'; this.style.backgroundColor='#2a78c6'; this.style.backgroundImage='url(images/nav-bg-hover.png)'"
    onMouseOut="this.style.color='#2a78c6'; this.style.backgroundColor='#3c3c3c'; this.style.backgroundImage='url(images/nav-bg.png)'">
    LINK
    </td>
    </tr>
    </table>
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P

  • Users who have thanked DJCMBear for this post:

    jimmyd (12-19-2010)

  • #3
    New Coder
    Join Date
    Dec 2010
    Posts
    32
    Thanks
    4
    Thanked 0 Times in 0 Posts
    wow, so simple. thanks a lot.


  •  

    Posting Permissions

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