Ik ben bezig om een crossbrowser slideshow aan te passen voor eigen gebruik. Hierbij heb ik 2 nieuwe fucties ingevoerd 'first()' en 'last()' om respectievelijk naar het eerste en het laatste plaatje in de reeks te gaan.
Deze 2 functies werken niet (in beide browsers) en ik kan niet vinden wat er fout aan is
.
Verder zijn dit de 2 functies waar ik het op gebaseerd heb (lopen door):
De hele broncode (let niet op de plaatjes :))
Ik hoop dat iemand mij kan helpen...
Deze 2 functies werken niet (in beide browsers) en ik kan niet vinden wat er fout aan is
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| function first()
// to show the first image
{
which=0;
document.images.photoslider.src=photos[which]
what=0;
document.rotater.description.value=text[what]
}
function last()
// to show the last image
{
which=photos.length-1;
document.images.photoslider.src=photos[which]
what=photos.length-1;
document.rotater.description.value=text[what]
} |
Verder zijn dit de 2 functies waar ik het op gebaseerd heb (lopen door):
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| function backward()
// to show the previous image
{
if (which>0)
{
which--
document.images.photoslider.src=photos[which];
what--
document.rotater.description.value=text[what];
}
else
{
which=photos.length-1;
document.images.photoslider.src=photos[which]
what=photos.length-1;
document.rotater.description.value=text[what]
}
}
function forward()
// to show the next image
{
if (which<photos.length-1)
{
which++
document.images.photoslider.src=photos[which];
what++
document.rotater.description.value=text[what];
}
else
{
which=0;
document.images.photoslider.src=photos[which]
what=0;
document.rotater.description.value=text[what]
}
} |
De hele broncode (let niet op de plaatjes :))
Ik hoop dat iemand mij kan helpen...