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 to the CF scene
    Join Date
    Dec 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cross platform compatability

    How do I make this script cross platform compatible? It works in IE but not FireFox



    <head>
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <script language=jscript>

    function doScroll()
    {
    var curH = document.body.scrollTop;
    window.status = "scrollTop = " + curH;
    try {
    myDiv.style.top = curH;
    }
    catch(e)
    {
    window.status = e.message;
    }
    }
    </script>
    </head>

    <body onscroll="doScroll();">
    <div id="myDiv" style="position:absolute;top:0px;right:5px;width:20%;height:100%;color:red;text-align:center;font-weight:bold">

  • #2
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found this but don’t know how to implement it.
    http://www.quirksmode.org/js/events_access.html

    Cross-browser event accessing
    Fortunately it is very easy to write a proper cross-browser script:
    element.onclick = doSomething;

    function doSomething(e)
    {
    if (!e) var e = window.event;
    // e gives access to the event in all browsers
    }
    If the variable e does not exist (if it isn’t sent to the function), make it a reference to window.event . Now e refers to the event in all browsers.

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Error message in javascript console says:

    “Error: doScroll is not defined”
    Last edited by dsirois1; 12-30-2005 at 09:41 PM.


  •  

    Posting Permissions

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