473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to link to specific images in a Javascript slideshow

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, depending on where the user is in the site.

Does anyone know where I can find code that does this? I am somewhat
familiar with Javascript but would like to find some ready-made code
which accomplishes this.

Thanks for all help and suggestions!!

--JAG
Jul 23 '05 #1
2 2099
Jeannie wrote:
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, depending on where the user is in the site.

Does anyone know where I can find code that does this? I am somewhat
familiar with Javascript but would like to find some ready-made code
which accomplishes this.

Thanks for all help and suggestions!!

--JAG


I don't know about ready made code - however it shouldn't prove to
difficult to come up with some sort of a solution since you already have
some javascript skills. There are a couple of things you might already
know, but you've not connected them...

First, when you open your popup window with window.open, you give the
popup window a name... If you use the same window name as a target in
any of your other pages, it will update the popup window - And if its
not already open (perhaps the user closed it) then a new one will open.

The only problem that I could forsee is that you might want a popup that
is larger then the one opened in an earlier window in which case you
might have to resize it (which I believe is possible on most recent
popular browsers but I've never written code for it).

Does that help you any, or do you still need some code? In my early days
of learning javascript I used to examine some of the code at
javascript.inte rnet.com however not all of it is environmentally
friendly (in such that it may be unclean code, achieveing results that
could be achieved with less resources using alternative methods).
Still, its helps me along... maybe you might find what you're looking
for there.

randelld
Jul 23 '05 #2
Thanks - though I wasn't able to quite come up with a solution yet. I
am putting my code here, maybe that will help. If anyone can make
suggestions on how to alter it, that would be much appreciated!

Here's the code for the popup slideshow I have now which currently is
running.
*************** *************** *************** **
<html>
<head>
<script language="JavaS cript">
<!--
var interval = 30000;
var random_display = 0;
var imageDir = "images/";

var imageNum = 0;
imageArray = new Array();
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_airplan e.jpg");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_airplan e.jpg");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_humidor .jpg");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_humidor 2.jpg");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_lounge1 .jpg");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_lounge2 .jpg");
imageArray[imageNum++] = new imageItem(image Dir + "im_pop_udr.jpg ");
imageArray[imageNum++] = new imageItem(image Dir +
"im_pop_winecel .jpg");

var totalImages = imageArray.leng th;

function imageItem(image _location) {
this.image_item = new Image();
this.image_item .src = image_location;
}
function get_ImageItemLo cation(imageObj ) {
return(imageObj .image_item.src )
}

function randNum(x, y) {
var range = y - x + 1;
return Math.floor(Math .random() * range) + x;
}
function getNextImage() {
if (random_display ) {
imageNum = randNum(0, totalImages-1);
}
else {
imageNum = (imageNum+1) % totalImages;
}

var new_image = get_ImageItemLo cation(imageArr ay[imageNum]);
return(new_imag e);
}

function getPrevImage() {
imageNum = (imageNum-1) % totalImages;
var new_image = get_ImageItemLo cation(imageArr ay[imageNum]);
return(new_imag e);
}

function prevImage(place ) {
var new_image = getPrevImage();
document[place].src = new_image;
}

function switchImage(pla ce) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "switchImage('" +place+"')";
timerID = setTimeout(recu r_call, interval);
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td><img src="images/im_pop_airplane .jpg" width="442" height="288"
alt="" border="0" img name="slideImg" ></td>
</tr>
<tr>
<td class="closelin k"><a href="#" onClick="prevIm age('slideImg') ;
clearTimeout(ti merID)" class="closelin k"> &lt;&lt;previou s</a> </td>
<td></td>
<td align="right" class="closelin k"><a href="#"
onClick="switch Image('slideImg '); clearTimeout(ti merID)"
class="closelin k">next&gt;& gt; </a></td>
</tr>
<tr>
</table>
</body>
</html>
*************** *************** *************** **************

The code above is the actual slideshow code which runs in a popup
window. I want to be able to call up the slideshow popup from other
pages in my website, but have it start at an image I specify.

For instance, on one page, I use this code to call up the slideshow
popup:
<a href="javascrip t:popUp('banque t_tour.html')"> <img
src="images/bt_bd_pic2.jpg" width="234" height="153" alt=""
border="0"></a>

It always defaults to the first popup in the array. How can I ask it
to start with a different specific image in the array?
*************** *************** *************** **

Reply Via Newsgroup <re************ ****@please.com > wrote in message news:<LpJdc.635 27$oR5.13701@pd 7tw3no>...
Jeannie wrote:
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, depending on where the user is in the site.

Does anyone know where I can find code that does this? I am somewhat
familiar with Javascript but would like to find some ready-made code
which accomplishes this.

Thanks for all help and suggestions!!

--JAG


I don't know about ready made code - however it shouldn't prove to
difficult to come up with some sort of a solution since you already have
some javascript skills. There are a couple of things you might already
know, but you've not connected them...

First, when you open your popup window with window.open, you give the
popup window a name... If you use the same window name as a target in
any of your other pages, it will update the popup window - And if its
not already open (perhaps the user closed it) then a new one will open.

The only problem that I could forsee is that you might want a popup that
is larger then the one opened in an earlier window in which case you
might have to resize it (which I believe is possible on most recent
popular browsers but I've never written code for it).

Does that help you any, or do you still need some code? In my early days
of learning javascript I used to examine some of the code at
javascript.inte rnet.com however not all of it is environmentally
friendly (in such that it may be unclean code, achieveing results that
could be achieved with less resources using alternative methods).
Still, its helps me along... maybe you might find what you're looking
for there.

randelld

Jul 23 '05 #3

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

Similar topics

2
1608
by: Raphael Gluck | last post by:
Hi everyone I am not pretty well versed with javascript, and i am sure many you see questions like these every day. But I am looking for a simple javascript, that stores a few images, and flicks thru them, a bit like an animated gif, first one shows and dissapears, then another in its place. I am not sure what it is called, what the correct terminology is, as i am searching for "tickers" and not getting much luck,
1
1903
by: charliewest | last post by:
I am trying use server controls or web controls to simulate the following behavior. I've an image wrapped w/in a link to create a rollover effect as if both elements we're one graphic: <a href="javascript:submit();" onMouseOver="MM_swapImage('Image1221','','images/btn_green_on.gif',1)" onMouseOut="MM_swapImgRestore()" id="A1" runat="server"> Next <img src="images/btn_green.gif" alt="Next" name="Image1221" width="16" height="16"...
2
9170
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
2
5404
by: Whitney | last post by:
I ran across a chunk of code that allows me to blend images in and out (works great!) but now I need to figure out a way to randomize the order that these images appear. I have a bunch of pics and I'd like to give them all a fair shot at getting seen =) Any help would be GREATLY appreciated!! Here's the code: <HEAD>
8
2036
by: drillbit_99 | last post by:
I have an HTML page of thumbnail images. Each image can begin a slideshow of the images on the page by clicking on the image. This opens another HTML page that begins the slideshow using large images of the thumbnails. When the slideshow begins it always starts with the first image. I would like to pass the name of the thumbnail to the slideshow HTML page and begin the slideshow with the same image the user clicks on. Is this asking...
6
1924
by: busterama | last post by:
It's probably something simple, but I just can't find the solution. I'm using the javascript slideshow code at http://javascript.internet.com/miscellaneous/fading-slide-show.html for a slideshow on a webpage. Right now I'm prototyping the page on my computer, and eventually it'll move to the server. The script works fine when the images are in the same folder as the
1
3347
by: ttamilvanan81 | last post by:
Hai everyone, I need to provide the slideshow for the images. I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those images. I have try with the following jsp code. <%@ page language="java" %> <%@ page import="java.sql.*"%> <%@ page import="java.sql.Connection.*"%> <%@ page import="java.awt.image.*"%>
4
1488
by: Terry | last post by:
Hi folks. I am about to embark on creating a slideshow using javascript and css. I was wondering what do people consider the best way to preload the images to be used within the show. I saw a technique where the images were stored in 1 px by 1px divs with overflow set to hidden.
3
1991
by: kennykenn | last post by:
im producing a banner and want the banner to rotate and fade in and out to the next image. i want to link each image to a SEPERATE site! I can get it to work with out the fading effect and can get them all to link to one site with fading! both images and links are in seperate arrays! please help someone! code below: <html> <body onLoad="runSlideShow()" > <SCRIPT LANGUAGE="JavaScript"> var slideShowSpeed = 10000;
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
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
9174
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
9111
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
8096
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...
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
4517
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
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.