Results 1 to 2 of 2

Thread: Depressible Image Link Script

  1. #1
    Join Date
    Dec 2005
    Location
    Canada
    Posts
    82
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Depressible Image Link Script

    1) Script Title:
    Depressible Image Link Script
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex4/image1.htm
    3) Describe problem:
    I put the script into the head, and the second part into the body inside of a list, but the images I want to use won't show up. Here is the code:

    Code:
    <html>
    <head>
    <link rel= "stylesheet" href="css.css">
    <script language="javascript1.2">
    <!--
    
    /*
    Depressible Image Script- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions,
    100's more DHTML scripts, and Terms Of
    Use, visit dynamicdrive.com
    */
    
    img1=new Image()
    img1.src="up1.gif"
    img2=new Image()
    img2.src="down1.gif"
    //-->
    </script>
    
    </head>
    
    <body>
    <!-- Site navigation menu -->
    <ul class="navbar">
      <li>Movies In:</li>
      <li<a href="2008.html" onMousedown="document.images['example'].src=img2.src" onMouseup="document.images['example'].src=img1.src">
    <img src="up1.gif" name="example" border=0></a>
    </a>
    The image doesn't load even though both of the image files are named correctly and within the same folder. Can anyone please tell what stupid mistake I'm making?
    Last edited by jscheuer1; 02-07-2008 at 03:03 AM. Reason: change quote tags to code tags

  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

    What you have in your post here:

    Code:
    <li<a href="2008.html" onMousedown="document.images['example'].src=img2.src" onMouseup="document.images['example'].src=img1.src">
    <img src="up1.gif" name="example" border=0></a>
    </a>
    is sloppy coding. There is no link because the opening li tag isn't closed, it lacks a >, and (less important) the li tag itself has no closing tag. It should look like so:

    Code:
    <li><a href="2008.html" onMousedown="document.images['example'].src=img2.src" onMouseup="document.images['example'].src=img1.src">
    <img src="up1.gif" name="example" border=0></a>
    </li>
    There could also be other problems.
    - 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
  •