473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Array slideshow problem

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

<script type="text/javascript">

var photos=new Array()
var which=0

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

function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.fl oor(Math.random()*23)
photoslider.filters.revealTrans.stop()
}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

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

function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

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

</script>

then using this
<script>
if (linkornot==1)
document.write('<a href="javascript:transport()">')
document.write('<img src="'+photos[0]+'" name="photoslider"
style="filter:revealTrans(duration=2,transition=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 1720
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(slideshow)
....
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.referrer 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?showpicture=thatone'),
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(projectdetails), 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(projectdetails), 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?showpicture=thato*ne'),
and your page can parse this informaiton out of location.query


I should have written 'location.search'

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.length ) 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(nameval[0]), unescape(nameval[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
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...
4
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...
4
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...
8
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...
11
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'...
22
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...
5
by: Blurbint | last post by:
is there someway to etc, send keys to another running application with vb 6.0?
2
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...
2
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:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.