Hello All,
I am making an image gallery. I have it basically set up now (thanks to you guys here at WD), and I have one more question. I would like the thumbnails at the top of my page (here's an example of the gallery: Click! ) to display at 50% opacity until either they're moused over, or they're clicked on. Is this at all possible? Here is my current javascript:
and here is an example of the code of one of the images in case that helps:PHP Code:var img = new Array(6); //array to hold the images
var counter = 0; //counts the image sequences
if(document.images) //pre-load all the images
{
for(i = 1; i <= 6; i++)
{
img[i] = new Image();
img[i].src = "images/gallery1-" + i + ".jpg";
}
}
function next()
{
counter++;
if(counter == img.length)
counter = 1;
document.theimage.src = img[counter].src;
}
function prev()
{
counter--;
if(counter <= 0)
counter = img.length - 1;
document.theimage.src = img[counter].src;
}
function thumb(i)
{
if (document.theimage){
document.theimage.src = img[i].src;
document.theimage.style.display="block";
}
counter = i
return true
}
Hope that all makes sense. Thanks much!PHP Code:<a href="#" onClick="thumb(1);return false"><img name="1" src="thumbnails/gallery1-1T.jpg" width="45" height="60"></a>
-Jon


Reply With Quote
Bookmarks