Howdy. I'm writing a photo slideshow in javascript (using js to make
it more user-universal). I have the functions set up to get a photo
thumb from an array and link it to its larger counterpart, opening it
in another window. That works well, but when I call the function again
to write the next picture, document.write puts it in it's own page. I
want it to write the next picture where the first one was. Any
thoughts?
---------------------------------------------------------------------
Simplified Code:
var blackandwhite = new Array(); // all black and white pictures
var pathlarge = "large/";
var paththumb = "thumb/";
var currentpicture = 0;
var currentpicture_ blackandwhite = 0;
// Fill the arrays with pictures
blackandwhite[0] = "/blackandwhite/test.jpg";
blackandwhite[1] = "/blackandwhite/test2.jpg";
function displayPictureF rame(albumToDis play, currentpicture)
{
if (albumToDisplay == "blackandwhite" )
{
currentpicture_ blackandwhite = currentpicture;
document.write( "<a href=" + pathlarge +
blackandwhite[currentpicture_ blackandwhite] + " target=_blank>< img
src=" + paththumb + blackandwhite[currentpicture_ blackandwhite] + "
border=0></a>");
}
else
{
document.write( "No picture frame selected...");
}
}
---------------------------------------------------------------------
HTML Call:
<table width="100%">
<td width="25%" align="center" valign="middle" bgcolor="#00669 9">
<script>display PictureFrame('b lackandwhite', 0);</script>
<br><a
href="javascrip t:displayPictur eFrame('blackan dwhite',current picture_blackan dwhite-1)"><--</a>
| <a
href="javascrip t:displayPictur eFrame('blackan dwhite',current picture_blackan dwhite+1)">--></a>
</td>
</table>
---------------------------------------------------------------------
Implementation:
http://www.ryankavalsky.com/pictures/pictures_test.htm
---------------------------------------------------------------------
Thanks!