473,566 Members | 3,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Array slideshow problem

Hi I am new to javascript and I am using a code that brings up
pictures(slides how) with this code

<script type="text/javascript">

var photos=new Array()
var which=0

photos[0]="../images/fullfc_pe_04.jp g"
photos[1]="../images/fullfc_pe_05.jp g"
photos[2]="../images/fullfc_pe_06.jp g"
photos[3]="../images/fullfc_pe_07.jp g"
photos[4]="../images/fullfc_pe_08.jp g"
photos[5]="../images/fullfc_pe_09.jp g"
photos[6]="../images/fullfc_pe_12.jp g"
var preloadedimages =new Array()
for (i=0;i<photos.l ength;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}

function applyeffect(){
if (document.all && photoslider.fil ters){
photoslider.fil ters.revealTran s.Transition=Ma th.floor(Math.r andom()*23)
photoslider.fil ters.revealTran s.stop()
}
}

function playeffect(){
if (document.all && photoslider.fil ters)
photoslider.fil ters.revealTran s.play()
}

function keeptrack(){
window.status=" Image "+(which+1) +" of "+photos.le ngth
}
function backward(){
if (which>0){
which--
applyeffect()
document.images .photoslider.sr c=photos[which]
playeffect()
keeptrack()
}
}

function forward(){
if (which<photos.l ength-1){
which++
applyeffect()
document.images .photoslider.sr c=photos[which]
playeffect()
keeptrack()
}
}

function transport(){
window.location =photoslink[which]
}

</script>

then using this
<script>
if (linkornot==1)
document.write( '<a href="javascrip t:transport()"> ')
document.write( '<img src="'+photos[0]+'" name="photoslid er"
style="filter:r evealTrans(dura tion=2,transiti on=23)" border=0>')
if (linkornot==1)
document.write( '</a>')
</script>

I got that code from a co-worker who got it at a free code site and I
know some of it isnt used. The question I have is can I tell a link
from a another page which picture I want it to load, if so how would I
go about that, thanks in advance.

Jul 23 '05 #1
7 1736
you can if you are have persmission to edit the other page which has
the link. Otherwise you can't make any changes to pages that does not
belong to you and that link to your page.

Jul 23 '05 #2
Yes this is another page(with the link) in our site

Jul 23 '05 #3
Rabel wrote:
Hi I am new to javascript and I am using a code that brings up
pictures(slides how)
....
I got that code from a co-worker who got it at a free code site and I
know some of it isnt used. The question I have is can I tell a link
from a another page which picture I want it to load, if so how would I
go about that, thanks in advance.


'Can I tell a link from another page [what to do?]'

Not exactly clear what you're after.

Do you mean changing the picture that's displayed on your page,
depending on what page linked to it?
Use document.referr er to find out where they came from.

Do you mean that you want people to be able to link to your page and
specify a default image to display?
The link can use a GET-type query-string
(i.e. 'mypage.html?sh owpicture=thato ne'),
and your page can parse this informaiton out of location.query

Jul 23 '05 #4
you had it I would like to add a query string - see now it brings up
the first picture in the array when you come to the
page(projectdet ails), but there is multiple pictures you could choose
on the previous page(project), I need to make it come up with the
picture you choose on the previous page. any ideas how I would do that?

Jul 23 '05 #5
Rabel wrote:
you had it I would like to add a query string - see now it brings up
the first picture in the array when you come to the
page(projectdet ails), but there is multiple pictures you could choose
on the previous page(project), I need to make it come up with the
picture you choose on the previous page. any ideas how I would do that?
I wrote: The link can use a GET-type query-string
(i.e. 'mypage.html?sh owpicture=thato *ne'),
and your page can parse this informaiton out of location.query


I should have written 'location.searc h'

Parse your page's location.search , using the String.split() method and
the predefined unescape() function.

Then you have a method by which the previous (or any other) page can
tell your page which picture to show.

Play with it-- you'll find it relatively straightforward , if a little
tedious.

Jul 23 '05 #6
thanks Random, I am pretty new to javascript any sample code you can
throw in, thanks again

Jul 23 '05 #7
Rabel wrote:
thanks Random, I am pretty new to javascript any sample code you can
throw in, thanks again


I generally prefer not to write people's code for them as it usually
doesn't lead to any real learning or understanding (it's also generally
a good idea not to ask). Really I recommend researching the ample
information I included in my previous reply and finding out how to make
it work best for you. It's a good exercise.

But a couple of years ago I wrote the following little snippet with the
intent of writing people's code for them. Bear in mind, I haven't
revisited it since.

function parseGet( URL ) {
var pgs = new Array();
var nameval = new Array();
var pgr = new Array();
if( ! arguments.lengt h ) URL = location.href;

pgs = URL.split('?');
if( ! pgs[1] ) return null;
pgs = pgs[1].split('&');

for( var c = 0; c < pgs.length; c++ ) {
nameval = pgs[ c ].split('=');
pgr[ c ] = [ unescape(nameva l[0]), unescape(nameva l[1]) ];
pgr[ pgr[ c ][ 0 ] ] = pgr[ c ][ 1 ];
}

return pgr;
}

Jul 23 '05 #8

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

Similar topics

2
2259
by: Patrice | last post by:
Hi, I want to populate a multidimentional asp array from a database. Then convert this asp array to a javascript array as to make a slideshow with a description text and hyperlink. My problem is that the code seems to work well until it changes of column and then an error message pops-up: '' 'fadeimages.1' is null or no an object''. Can...
4
1621
by: Luis Veras | last post by:
I have a slideshow on my main page at www.canvasartists.com. Many of my visitors started to complain that on their screen the slideshow displays as flashing and/or blinking very quickly, and you can't really appreciate the slideshow effect, which is supposed to be a nice crossfade between the images. I then realized than when viewed at...
4
3733
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just did a preload script. But then the user has to sit for 5 minutes waiting for 63 images to download! My images are about 640x480 and average 100kb. Is...
8
2025
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...
11
2393
by: David Graham | last post by:
Hi New to javascript. I'm trying to understand how a script at a website I come across works. http://www.BRPPISAFETY.COM Nearly got it but I have changed the variable called 'crossFadeDuration' to large numbers and small numbers but it doesn't seem to do anything. Could someone explain what effect changing this variable should bring about...
22
5106
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...
5
2060
by: Blurbint | last post by:
is there someway to etc, send keys to another running application with vb 6.0?
2
5362
by: tequilamala | last post by:
I wanna put some images on my page that change everyfew seconds or so. The problem is that when the "slideshow" begins the veryfirst image is a blank and then it goes into the show. How do I get rid of the first blank? Heres the code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">...
2
1351
helimeef
by: helimeef | last post by:
Hiya, I'm upgrading a this slideshow to Object Oriented code (so I can reuse it for other clients), and I'm having some problems getting the library to work. Here is what it's like so far: (function(){ var img; var imgArr; var currSlide = 0; function Slideshow(image,slides) { img = document.getElementById(image); imgArr = slides;...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8109
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...
0
7953
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...
0
6263
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...
1
5485
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...
0
5213
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...
1
2085
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
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
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...

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.