SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    PA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image Gallery thumbnails not showing in IE

    Ok, I created a little image gallery to display photos similar to ebay. Initially I had problems with the javascript in mozilla, then someone pointed me in a direction to fix it.

    Now that I got it fixed to work in mozilla, it won't show thumbnails in IE.

    Here is an exaple of the latest that works in Mozilla:

    www.evolutionmsport.com/image2.php

    here is the one that works in ie and not mozilla:

    www.evolutionmsport.com/image.php

    Here is the code from the image3.php file, which is the one I will go with.

    <?php require_once("phpconfig/dbConfig.php") ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Evolution Motorsport</title>
    <link href="<?php echo $dd_Site."common/evm.css"?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo $dd_Site."common/evmtext.css"?>" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


    <script type="text/javascript">

    function changeImg(iSrc) {

    document.getElementById('mainImg').src = iSrc;
    }
    </script>

    <style>
    #ImageContainer{
    position:relative;
    width:412px;height:262px;
    padding:5px;
    margin:0px;
    border:1px solid #000;
    }

    #image1{
    position:absolute;
    top:50%;
    left:50%;
    margin-top:-125px;
    width:400px;
    height:250px;
    margin-left: -200px;
    }

    #tnContainer{
    position:relative;
    width:450;
    clear:both;
    padding:5px 0px;
    margin:0px;
    }
    #evmGallery{
    padding:10px;
    position:relative;
    }

    </style>



    </head>
    <body>
    <?php $ProdImage="watts";
    $imgType="jpg";?>


    <div id="evmGallery">

    <div id="ImageContainer">
    <div id="image1"><img id="mainImg" src="<?php echo $dd_Site."images/".$ProdImage."1.".$imgType; ?>" width="400" height="250" border="0"></div>
    </div>

    <div id="tnContainer">
    <a href="#"<img src="<?php echo $dd_Site."/images/tn_".$ProdImage."1.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."1.".$imgType; ?>');"></a>
    <a href="#"<img src="<?php echo $dd_Site."/images/tn_".$ProdImage."2.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."2.".$imgType; ?>');"></a>
    <a href="#"<img src="<?php echo $dd_Site."/images/tn_".$ProdImage."3.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."3.".$imgType; ?>');"></a>
    <a href="#"<img src="<?php echo $dd_Site."/images/tn_".$ProdImage."4.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."4.".$imgType; ?>');"></a>
    </div>
    </div>
    </body>
    </html>


    Am I missing anything obvious? The thumbnails show fine in mozilla, but not IE?????

    Thanks....Mike
    Evolution Motorsport
    The Performance Company

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Err. The anchor tags are out of wack

    <a href="#"<img src="<?php echo $dd_Site."/images/tn_".$ProdImage."3.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."3.".$imgType; ?>');"></a>

    Should be:

    <a href="#"><img src="<?php echo $dd_Site."/images/tn_".$ProdImage."3.".$imgType;?>" width="100" height="63" border="1" style="float:left;margin-right:5px;cursor: pointer;" onclick="changeImg('<?php echo $dd_Site."images/".$ProdImage."3.".$imgType; ?>');"></a>
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    PA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by The New Guy
    Err. The anchor tags are out of wack

    Well now I feel like a dope..., I knew it had to be something simple....Thanks, that worked like a charm, and I would have never found that one.....

    Thanks again....Mike
    Evolution Motorsport
    The Performance Company


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
  •