onmouseover IE - Firefox

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

  1. NetFlash

    NetFlash

    Joined:
    Sep 5, 2008
    Messages:
    2
    Likes Received:
    0
    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. Advertisements

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,423
    Jerry III
    Aug 6, 2003
  2. Jay
    Replies:
    2
    Views:
    42,616
    Alex Papadimoulis
    Sep 30, 2003
  3. Frances Valdes

    Onmouseover

    Frances Valdes, Mar 2, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    971
    Frances Valdes
    Mar 3, 2004
  4. =?Utf-8?B?QXZpIFNoaWxvbg==?=

    OnMouseOver for a DataGrid control

    =?Utf-8?B?QXZpIFNoaWxvbg==?=, Jul 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,489
    Mr. Dot Net
    Jul 12, 2004
  5. Jordan
    Replies:
    1
    Views:
    4,034
    Bruce Barker
    Jun 10, 2005
  6. Richard Brooks

    onMouseOver event in Map in Firefox.

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

    onmouseover IE - Firefox

    NetFlash, Sep 8, 2008, in forum: HTML and CSS
    Replies:
    0
    Views:
    739
    NetFlash
    Sep 8, 2008
  8. VK
    Replies:
    9
    Views:
    342
Loading...