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
    Jun 2002
    Location
    Colorado
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Fly-in text script

    hey every one, I can't get this fly in text script to work. It says there is an error on line 99.

    Here is the script:

    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    var isNav, isIE, intervalID
    var coll = ""
    var styleObj = ""
    if (parseInt(navigator.appVersion)>=4) {
    if (navigator.appName == "Netscape") {
    isNav = true
    } else {
    isIE = true
    coll = "all."
    styleObj = ".style"
    }
    }
    //Utility function returns height of object in pixels
    function getObjHeight(obj) {
    if (isNav) {
    return obj.clip.height
    } else {
    return obj.clientHeight
    }
    }
    //Utility function returns width of object in pixels
    function getObjWidth(obj) {
    if (isNav) {
    return obj.client.width
    } else {
    return obj.clientWidth
    }
    }
    //Utility function returns the x coordinate of a positionable object
    function getObjLeft(obj) {
    if (isNav) {
    return obj.left
    } else {
    return obj.pixelLeft
    }
    }
    //Utility function returns the y coordinate of a positionable object
    function getObjTop(obj) {
    if (isNav) {
    return obj.top
    } else {
    return obj.pixelTop
    }
    }
    //Utility function returns the available content width space in borwser window
    function getInsideWindowWidth() {
    if (isNav) {
    return window.innerWidth
    } else {
    return document.body.clientWidth
    }
    }
    //Utility function returns the available content height space in browser window
    function getInsideWidnowHeight() {
    if (isNav) {
    return window.innerHeight
    } else {
    return document.body.clientHeight
    }
    }
    //Utility function sets the object visibility to visible
    function show(obj) {
    obj.visibility = "visible"
    }

    //Utility function sets the object visibility to hidden
    function hide(obj) {
    obj.visibility = "hidden"
    }
    //Utility function positions an element at a specific x, y location
    function shiftTo(obj, x,y) {
    if (isNav) {
    obj.moveTo(x,y)
    } else {
    obj.pixelLeft = x
    obj.pixelTop = y
    }
    }
    //Utility function to move an object by x and/or y pixels
    function shiftBy(obj, deltaX, deltaY) {
    if (isNav) {
    obj.moveBy(deltaX, deltaY)
    } else {
    obj.pixelLeft += deltaX
    obj.pixelTop += deltaY
    }
    }
    //**End library code**
    //Set initial position offscreen and show object and
    //start timer by calling glideToCenter()
    function intro() {
    var obj = eval("document." + coll + "banner" + styleObj)
    var contentObj = eval("document." + coll + "banner")
    shiftTo(obj, getInsideWindowWidth(),
    Math.round((getInsideWindowHeight()/2)-(getObjHeight(contentObj)/2)))
    show(obj)
    glideToCenter()
    }
    //Move the object to the left by 5 pixels until it's centered
    function glideToCenter() {
    var obj = eval("document." + coll + "banner")
    shiftBy(obj,-5,0)
    var a = getObjLeft(obj)
    var b = math.round((getInsideWindowWidth()/2) - (getObjWidth(contentObj)/2))
    if (a<=b) {
    clearTimeout(intervalID)
    } else {
    intervalID = setTimeout("glideToCenter()",1)
    }
    }
    </script>





    <title>Fly-in</title>
    </head>

    <body onLoad="intro()">
    <DIV ID="banner" STYLE="position:absolute; visibility:hidden; left:0; top:0; background-color:blue; width:1; height:1">
    <P ID="txt" STYLE="position:absolute; left:0; top:0; font-size:36pt; color:black">
    Check it out dude, I'm flyin'!!!
    </P>


    </body>
    </html>


    Any ideas??
    ?Hا?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to use the Javascript Console in Netscape, then you'd have seen that getInsideWindowHeight was not defined. That should have clued you in to look for that function where you'd have seen that it was mis-spelled as getInsideWidnowHeight .

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Colorado
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DOH!

    AH! I knew it was something small. Thank you for your input. I shall see how it works now.
    ?Hا?


  •  

    Posting Permissions

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