Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Nixa, Missouri, USA
    Thanked 0 Times in 0 Posts

    Dual image flip problem

    The boss wants a new web site so I get the job. Fine!
    The boss wants to hover over one of several small product images and have a large image change to the product being hovered over AND the small image to change to a different picture of the same type product, OK Mouseover not a big deal.
    My JavaScript code is flawed.
    I have the above complete but ImageSmall1 changes when you hover ImageSmall2 or ImageSmall3 as well as ImageSmall1. In other words each image is not changing only the first.
    Since the lounge moved I have lost how to create effects and hyper links here and no longer see "attachements" so the code is below.
    I am sure the problem is in my "document.images..." section but I am not quite sure.

    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Content-Language" content="en-us">
    <title>DPC Product 3</title>
    <script language="javascript">
    //This is the preloading of the large mouseover dual image swap images
    //this is the main large images
    alt0 = new Image();
    alt0.src = "images/index.1.jpg";
    //This is the image for the 1st picture - construction
    alt1 = new Image();
    alt1.src = "images/constr1.jpg";
    //This is the 2nd image which is lost foam
    alt2 = new Image();
    alt2.src = "images/lost_f11.jpg";
    //This is the 3rd image which is packaging
    alt3 = new Image();
    alt3.src = "images/packag13.jpg";
    //Here are the small images
    //graphic one combines jpg and gif and needs a 2nd picture
    graphic1= new Image();
    graphic1.src = "images/constr1_small.jpg";
    graphic1on = new Image();
    graphic1on.src = "images/prodimg.gif";
    graphic2= new Image();
    graphic2.src = "images/hydrantcomp_small.jpg";
    graphic2on = new Image();
    graphic2on.src = "images/lost_f12.jpg";
    graphic3= new Image();
    graphic3.src = "images/stock_20.jpg";
    graphic3on = new Image();
    graphic3on.src = "images/packag16.jpg";
    //now we call for the function to swap the pictures
    function imageChange
    (imageID,imageName,imageID2,imageName2,imageID3,im ageName3) {
    document.images[imageID].src = eval(imageName + ".src");
    document.images[imageID2].src = eval(imageName2 + ".src");
    document.images[imageID3].src = eval(imageName3 + ".src");

    <p align="center">
    <a href = "home.htm"
    onmouseover="imageChange('global','alt1','one','gr aphic1on')"
    onmouseout="imageChange('global','alt0','one','gra phic1')">
    <a href = "home.htm"
    onmouseover="imageChange('global','alt2','one','gr aphic2on')"
    onmouseout="imageChange('global','alt0','one','gra phic2')">
    <a href = "home.htm"
    onmouseover="imageChange('global','alt3','one','gr aphic3on')"
    onmouseout="imageChange('global','alt0','one','gra phic3')">

    // Yadda yadda yadda

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 93 Times in 89 Posts

    Re: Dual image flip problem

    The parameter 'one' appears in all calls to imageChange... I think that must be it.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Nixa, Missouri, USA
    Thanked 0 Times in 0 Posts

    Re: Dual image flip problem

    I apologize for the delay, WOPR used to "email" me when someone responded to my posts but this has quit working. After some communication with wolfman I think it is my system.
    Anyway "one" was it, everything was pointing back to picture "one" not to its correct picture "two" through "eight".
    It's all in the details.
    Thanks a Million

Posting Permissions

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