Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript Photo Slideshow

Reply
Thread Tools

Javascript Photo Slideshow

 
 
Ryan
Guest
Posts: n/a
 
      03-08-2006
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 displayPictureFrame(albumToDisplay, 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="#006699">
<script>displayPictureFrame('blackandwhite', 0);</script>
<br><a
href="javascript:displayPictureFrame('blackandwhit e',currentpicture_blackandwhite-1)"><--</a>
| <a
href="javascript:displayPictureFrame('blackandwhit e',currentpicture_blackandwhite+1)">--></a>
</td>
</table>
---------------------------------------------------------------------
Implementation:
http://www.ryankavalsky.com/pictures/pictures_test.htm
---------------------------------------------------------------------
Thanks!

 
Reply With Quote
 
 
 
 
Ryan
Guest
Posts: n/a
 
      03-08-2006
Alright, I got it. You just use a div, assign it an id, and write to
that specific div and not the page. If anyone wants the code, it'll be
at www.ryankavalsky.com/pictures.htm or around there somewhere.

 
Reply With Quote
 
 
 
 
Ryan
Guest
Posts: n/a
 
      03-09-2006
The source code is at
http://www.ryankavalsky.com/include/...ictureframe.js
and the code in action is at http://www.ryankavalsky.com/pictures.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeware photo slideshow with music software? Nozza Computer Support 6 09-20-2009 12:34 PM
free offer - Photo DVD Slideshow john Digital Photography 3 07-16-2004 01:33 PM
Photo data base and slideshow Tony Digital Photography 3 11-25-2003 02:55 PM
photo slideshow on TV Frances Digital Photography 2 07-25-2003 08:52 PM
Make hi-res photo slideshow VCD and view on TV Mike Vill Digital Photography 0 07-14-2003 03:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57