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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help.. mouseover!

    hi, i need some help. im a complete newb at this and im having some trouble with this mouseover code.
    this code works fine by itself. but when i add the code to another image, it works but will change the first image's mouseover to the same as the second one, when they're supposed to be different! hope this makes sense. ive checked to make sure i havent named any of the images the same. it just seems like whichever image ive done last overwrites all the others. am i missing something?

    Code:
    <script language="JavaScript">
    <!-- // start hidden code
    our_image = new Image();
    our_image.src ="img/image2.png";
    // done with hidden code -->
    </script>
    
    <a href="#" onMouseOver="image1.src=our_image.src";
    onMouseOut="image1.src='img/image1.png'";>
    <img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>

  • #2
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by zlkjd View Post
    hi, i need some help. im a complete newb at this and im having some trouble with this mouseover code.
    this code works fine by itself. but when i add the code to another image, it works but will change the first image's mouseover to the same as the second one, when they're supposed to be different! hope this makes sense. ive checked to make sure i havent named any of the images the same. it just seems like whichever image ive done last overwrites all the others. am i missing something?

    Code:
    <script language="JavaScript">
    <!-- // start hidden code
    our_image = new Image();
    our_image.src ="img/image2.png";
    // done with hidden code -->
    </script>
    
    <a href="#" onMouseOver="image1.src=our_image.src";
    onMouseOut="image1.src='img/image1.png'";>
    <img height="21" width="83" border="0" name="image1" src="img/image1.png"/></a>
    Code:
    <!-- not sure why you had this:
    <img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>
    -->
    Try this, mabey it will work:
    Code:
    <script language="JavaScript">
    <!-- // start hidden code
    our_image = new Image();
    our_imagetwo = new Image();
    our_image.src = "img/image2.png";
    our_imagetwo.src = "img/image3.png"
    <!-- or be image1.png -->
    // done with hidden code -->
    </script>
    <a href="#" onMouseOver="image1.src=our_image.src";
    onMouseOut="image1.src=our_imagetwo.src";>
    <img height="21" width="83" border="0" img name="image1" src="img/image1.png"/></a>
    Last edited by Goat Spirit; 12-08-2006 at 05:01 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
    •