onmouseover IE - Firefox

Discussion in 'HTML and CSS' started by NetFlash, Sep 5, 2008.

  1. NetFlash

    NetFlash

    Joined:
    Sep 5, 2008
    Messages:
    2
    K guys.....
    I'm not a very experienced javascripter... that's why i need your help here.

    A friend asked me to help solve his mouse over problem.
    When run in IE it works perfectly.....
    But doesn't in Firefox, Opera, Safari etc.......

    I think that's because these browsers don't support VBscript... So i need to convert the code below from VBScript to JavaScript

    Here's the code used....
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    <script type="text/vbscript" language="VBScript">
    Dim MenuBGColor,MenuBGColorMouseOver,DontHide
    MenuBGColor="#cccccc"
    MenuBGColorMouseOver="#acacac"
    Sub SetSubMenu(Src,Vis)
    document.getElementById("submenu"&Right(Src.ID,2)).style.pixelLeft=GetPos(document.getElementById("menu"&Right(Src.ID,2)),"Left")+document.getElementById("menu"&Right(Src.ID,2)).offsetWidth
    document.getElementById("submenu"&Right(Src.ID,2)).style.pixelTop=GetPos(document.getElementById("menu"&Right(Src.ID,2)),"Top")
    document.getElementById("submenu"&Right(Src.ID,2)).style.visibility=Vis
    End Sub
    Function GetPos(Src,sProp)
    Dim iPos,iSrc:Set iSrc=Src
    Do Until iSrc Is Nothing
    If sProp="Left" Then iPos=iPos+iSrc.offsetLeft Else If sProp="Top" Then iPos=iPos+iSrc.offsetTop
    Set iSrc=iSrc.offsetParent
    Loop:GetPos=iPos
    End Function

    </script>

    .... and later used in the body........
    <td id="menu01" align="right" onmouseout="SetSubMenu me,'hidden':me.bgcolor=MenuBGColor" onmouseover="SetSubMenu me,'visible':me.bgcolor=MenuBGColorMouseOver">
    <img width="15" height="1" alt="" src="img/blank.gif"/>
    <a style="font-family: arial; font-size: 14px; text-decoration: none; color: rgb(70, 70, 70);" href="index.aspx?pageid=28">Introductie</a>
    <img width="15" height="1" alt="" src="img/blank.gif"/>
    </td>

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    I would appreciate your help on this mather.....
    Last edited: Sep 8, 2008
    NetFlash, Sep 5, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tor Inge Rislaa
    Replies:
    3
    Views:
    16,122
    Jerry III
    Aug 6, 2003
  2. Jay
    Replies:
    2
    Views:
    41,656
    Alex Papadimoulis
    Sep 30, 2003
  3. Jordan
    Replies:
    1
    Views:
    3,823
    Bruce Barker
    Jun 10, 2005
  4. Richard Brooks

    onMouseOver event in Map in Firefox.

    Richard Brooks, Mar 7, 2005, in forum: HTML
    Replies:
    10
    Views:
    8,938
    Mark Parnell
    Mar 8, 2005
  5. NetFlash

    onmouseover IE - Firefox

    NetFlash, Sep 8, 2008, in forum: HTML and CSS
    Replies:
    0
    Views:
    607
    NetFlash
    Sep 8, 2008
Loading...

Share This Page