Jump to content

Image gallery to show first image.


unistake

Recommended Posts

Hi all,

 

I have a simple image gallery that shows 3 thumbnails and a larger image 'on hover'.

 

It works but I want to show the larger first image when as a standard image and change it when the other thumbnails are hovered over.

 

Thanks for the help.

 

The code I have is:

 

<style type="text/css">
/* STYLE FOR THE IMAGE GALLERY /////////////////////////////////////////////////////////////////*/
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */

.gallerycontainer{
position: relative;
width:620px;
height: 400px;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}

.thumbnail img{
margin-top: 15px;
}

.thumbnail span{ /*CSS for enlarged image*/
visibility:hidden;
position: absolute;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
}

.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: 15px;
left: 110px; /*position where enlarged image should offset horizontally */
z-index: 50;
}
</style>
</head>
<body>
<div class="gallerycontainer">
<a class="thumbnail" href="#thumb"><img src="../aircraft/G-BOAC1.jpg" width="100px" height="66px" border="0" /><span><img src="../aircraft/G-BOAC1.jpg" width="500px" height="350px" /><br />G-BOAC Picture 1</span></a>
<br />
<a class="thumbnail" href="#thumb"><img src="../aircraft/G-BOAC2.jpg" width="100px" height="66px" border="0" /><span><img src="../aircraft/G-BOAC2.jpg" width="500px" height="350px"/><br />G-BOAC Picture 2</span></a>
<br />
<a class="thumbnail" href="#thumb"><img src="../aircraft/G-BOAC3.jpg" width="100px" height="75px" border="0" /><span><img src="../aircraft/G-BOAC3.jpg" width="500px" height="350px" /><br />G-BOAC Picture 3</span></a> 
</div>
</body>

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.