-
Javasript Photo Gallery
Hello. I wonder if anyone can help. I’m building a website for my son with Mac Dreamweaver MX. I’d planned to download an extension for a flash gallery to display and manage my photos in dreamweaver, but hadn’t realised these wouldn’t be compatible with my 2002 version. I’ve used the photoshop web gallery in the past, but it’s such a faff if you want to add new images, or want the viewer to sit within one of your pages – so I decided to mash together a few scripts to get as far as the gallery on this page:
https://www.dunkydoughnut.co.uk/photos-firsthalloween.html
I’ll be swapping the links on the right with thumbnails, and fixing the first link once I’ve figured that bit out, but I’m really stuck with the big main picture. I’d like to specify the max space the image can take up, and have the pictures fill it whilst retaining their landscape/portrait aspect ratio. They look a bit weird stretched, but there must be an easier way than saving all the files again as .gifs so they are all exactly the same size but with bags of empty space around them. Anyone know of a piece of code I could add? Thanks
This is the code I’m using:
<td valign=top>
<script type="text/javascript">
function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
var picture = document.getElementById(pictureName);
if (picture.filters)
{
picture.style.filter="blendTrans(duration=1)";
picture.filters.blendTrans.Apply();
}
picture.src = imageFile;
if (picture.filters)
{
picture.filters.blendTrans.Play();
}
document.getElementById(titleCaption).innerHTML=captionText;
}
</script>
<img src="images/optimised gallery/Photos/h1.jpg" alt="Photo gallery" name="duncanGallery" "width="485" height="337" id="duncanGallery" style="border: 2px black solid"> <div id=duncanGalleryCaption>Mummy's Pumpkin</div>
<td valign=top>
<ol>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h1.jpg','duncanGalleryCaption','Mummy's Pumpkin')">Mummy's Pumpkin</a></li>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h2.jpg','duncanGalleryCaption','Duncan Opening Pumpkin')">Duncan Opening Pumpkin</a></li>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h3.jpg','duncanGalleryCaption','Duncan Sat By Pumpkin')">Duncan Sat By Pumpkin</a></li>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h4.jpg','duncanGalleryCaption','Duncan Skeleton')">Duncan Skeleton</a></li>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h5.jpg','duncanGalleryCaption','Duncan and Mummy')">Duncan and Mummy</a></li>
<li><a href="#_self" onclick="LoadGallery('duncanGallery','images/optimised gallery/Photos/h6.jpg','duncanGalleryCaption','Family Pic')">Family Pic</a></font></li>
</ol>
</td>