Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    17
    Member #
    1303
    Hello, I am designing a website, and I have a picture that I would like to change when some one mouses over it. Do you know if thats possiable, or where I could find the code for something like that. Thank you..

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    like this if you want it to stay as the second image...

    Code:
    
    <img src="pic1.gif" onMouseOver="this.src = 'pic2.gif';" border="0">
    or like this if you want it to return to picture 1...

    Code:
    
    <img src="pic1.gif" onMouseOver="this.src = 'pic2.gif';" onMouseOut="this.src = 'pic1.gif';" border="0">
    JR

  4. #3
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    An alternative to that would be this:
    Code:
    <script type="text/javascript">
     var preload = new Array();
     for (i=0;i>4;i++) {
      preload[i] = new Image();
     }
     preload.src = "img.jpg";
     preload.src = "img1.jpg";
     preload.src = "img13.jpg";
     preload.src = "img3.src";
    
     function swapImg(pic,swapSrc) {
      pic.src = swapSrc;
     }
    </script>
    <body>
    <img src="img.jpg" height="10" width="10"
     onMouseOver="swapImg(this,'img1.jpg')"
     onMouseOut="swapImg(this,'img.jpg')">
    <BR>
    <img src="img3.jpg" height="10" width="10"
     onMouseOver="swapImg(this,'img13.jpg')"
     onMouseOut="swapImg(this,'img3.jpg')">
    </body>
    - Brian


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:27 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com