473,725 Members | 2,168 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 1904
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
2100
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
2060
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
2378
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
2733
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
4141
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
5122
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
1691
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
1571
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
2030
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
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
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...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
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
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.