473,698 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript Photo Slideshow

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!

Mar 8 '06 #1
2 1901
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.

Mar 8 '06 #2
The source code is at
http://www.ryankavalsky.com/include/...ictureframe.js
and the code in action is at http://www.ryankavalsky.com/pictures. :)

Mar 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2098
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of the images. I'd like to use the same popup window at different points throughout the website and have the Virtual Tour (slideshow) open up at the appropriate photos. Meaning I'd like to control which picture the popup window opens up to,...
5
2055
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide, Previous Slide and Home Slide. Is it possible for you to view my page and tell me what I am doing wrong. I have looked at this page for hours and can't figure it out, I
6
2375
by: Dan Webb | last post by:
Hi All, Im currently working on ways of pacakaging javascript functions/variables/objects in a similar way to the Java package statement so that scripts can be interact with each other with the minimum risk of clashing (due to function/variable name clashes). Do any of you do this already and/or are there any techniques you've come across? Im aware that ECMAScript 2 has this facility and have seen several
4
2730
by: CB US 77 | last post by:
I use a piece of javascript to create a photo gallery slideshow. The slideshow part works great, but I would like to add captions to each picture. If you want to see the html, send me an email to usb15@cox.net. Any help would be great.
5
4136
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas why? If you have any other ideas on how the javascript can be improved, please let me know.
22
5119
by: bevoldjling | last post by:
Hi ! I need some help in putting together a website for our family gathering. Although I'm still pretty "green", I don't think what I need requires terribly advanced skills ...except for one area that has me right baffled. I want to put up a photo album slideshow but I want to stay away from Flash & Javascript. It just seems that anytime I use them, somebody
1
1689
by: gencode | last post by:
I have this bit if javascript and it animates an image well, the problem is that the more it runs the more memory it eats on the client machine. Can anyone help me make this not eat all avaliable memory, notice the recurrision, that may be it...is there a better way to it or free the last process ran...please help :D <script> // The following script implements rotating and fading the merchant logos. // Fade effect only in IE; degrades...
3
1569
by: Gaby Sandoval | last post by:
I have a very simple javascript slideshow. It is extremely basic (see small sample below): <script language="JavaScript1.1"> <!-- //specify interval between slide (in mili seconds) var slidespeed=100
0
2026
by: jasper98 | last post by:
Hi all, I've got a big problem trying to combine javascript with xml. I am using the Flash Slideshow Maker: http://www.flash-slideshow-maker.com/ to make some nice photo galleries, but they've got just a basic way of linking when clicking on the picture. If you have a look here: http://www.hthweb.com/001/ are all the files that come after doing a sample gallery. This is the page with the html/flash code:...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7721
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.