Results 1 to 4 of 4

Thread: Flying images aren't flying

  1. #1
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Flying images aren't flying

    1) Script Title: Floating Images Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/flyimage.htm

    3) Describe problem: Hey all,,,, don't look now but here's another newbie problem!
    The floating images script is killin' me.
    I'm changing the parts that it says to change,,i.e name of the picture file.

    <A HREF="http://dynamicdrive.com"><IMG SRC="test.gif" BORDER=0></a>
    </DIV>

    Here are my questions:
    The picture is in the same folder as the htm file,,do I need the <A HREF= ?stuff or can that line just start with the <IMG etc...?

    Then, is there anything in the "moveobj.js" file that needs to be changed?
    The directions don't say to but I'm running out of reasons for this thing not to work for me.
    Thanks,,Jerry

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You can remove:

    Code:
    <A HREF="http://dynamicdrive.com">  . . .  </a>
    from the markup, but you need to keep the rest, ex:

    Code:
    <div id="flyimage2" style="position:absolute;left:-500px;width:47;height:68;">
    <img src="test.gif" border="0">
    </div>
    The script itself doesn't need to be changed.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well,,,tried that but still no go. Here's what I'm using, (below), I have the .js file & beeback.gif in the same folder. What am I missing? The error I get is Line 22 character 2 chip is undefined. Thanks for the help



    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>

    <script type="text/javascript" src="moveobj.js"> </script>
    <script type="text/javascript">

    /***********************************************
    * Floating image script- By Virtual_Max (http://www.geocities.com/siliconvalley/lakes/8620)
    * Modified by Dynamic Drive for various improvements
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //Step 1: Define unique variable names depending on number of flying images (ie:3):
    var flyimage1, flyimage2, flyimage3

    function pagestart(){
    //Step 2: Using the same variable names as 1), add or delete more of the below lines (60=width, height=80 of image):
    flyimage1=new Chip("flyimage1",47,68);
    flyimage2=new Chip("flyimage2",47,68);
    flyimage3=new Chip("flyimage3",47,68);


    //Step 3: Using the same variable names as 1), add or delete more of the below lines:
    movechip("flyimage1");
    movechip("flyimage2");
    movechip("flyimage3");

    }

    if (window.addEventListener)
    window.addEventListener("load", pagestart, false)
    else if (window.attachEvent)
    window.attachEvent("onload", pagestart)
    else if (document.getElementById)
    window.onload=pagestart

    </script>
    </head>

    <body>
    <!-- Step 4: Define your flying images. For each image's ID tag, use the same variable names as 1) above -->

    <DIV ID="flyimage1" STYLE="position:absolute; left: -500px; width:47; height:68;">
    <img src="beeback.gif" border="0">
    </DIV>
    <DIV ID="flyimage2" STYLE="position:absolute; left: -500px; width:47; height:68;">
    <img src="beeback.gif" border="0">
    </DIV>
    <DIV ID="flyimage3" STYLE="position:absolute; left: -500px; width:47; height:68;">
    <img src="beeback.gif" border="0">
    </DIV>

    </body>

    </html>

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Works fine here:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript" src="moveobj.js"> </script>
    <script type="text/javascript">
    
    /***********************************************
    * Floating image script- By Virtual_Max (http://www.geocities.com/siliconvalley/lakes/8620)
    * Modified by Dynamic Drive for various improvements
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //Step 1: Define unique variable names depending on number of flying images (ie:3):
    var flyimage1, flyimage2, flyimage3
    
    function pagestart(){
    //Step 2: Using the same variable names as 1), add or delete more of the below lines (60=width, height=80 of image):
     flyimage1=new Chip("flyimage1",47,68);
     flyimage2=new Chip("flyimage2",47,68);
     flyimage3=new Chip("flyimage3",47,68);
    
    
    //Step 3: Using the same variable names as 1), add or delete more of the below lines:
    movechip("flyimage1");
    movechip("flyimage2");
    movechip("flyimage3");
    
    }
    
    if (window.addEventListener)
    window.addEventListener("load", pagestart, false)
    else if (window.attachEvent)
    window.attachEvent("onload", pagestart)
    else if (document.getElementById)
    window.onload=pagestart
    
    </script>
    </head>
    <body>
    <!-- Step 4: Define your flying images. For each image's ID tag, use the same variable names as 1) above -->
    
    <div id="flyimage1" style="position:absolute; left: -500px; width:47; height:68;">
    <img src="http://www.dynamicdrive.com/ballon4.gif" border=0>
    </div>
    
    <div id="flyimage2" style="position:absolute; left: -500px; width:47; height:68;">
    <img src="http://www.dynamicdrive.com/ballon2.gif" border=0>
    </div>
    
    <div id="flyimage3" style="position:absolute; left: -500px; width:47; height:68;">
    <img src="http://www.dynamicdrive.com/ballon3.gif" border=0>
    </div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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