Jay_23
11-10-2002, 12:20 AM
I am fairly new to Java, and I mostly copy and paste, and edit and learn as I go along. Now, the following script is for a slideshow. And all I want to know is how to make a 2nd image change when the slideshow image changes. (so, when I press the "next button", 2 images change simultaneously) If anyone can give me a quick hand, I'd appreciate it, thanks.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
prev1 = new Image (50,50);
prev1.src = "Leftarrow.jpg";
prev2 = new Image (50,50);
prev2.src = "LeftarrowA.jpg";
next1 = new Image (50,50);
next1.src = "Rightarrow.jpg";
next2 = new Image (50,50);
next2.src = "RightarrowA.jpg";
go1 = new Image (145,95);
go1.src = "go.jpg";
go2 = new Image (145,95);
go2.src = "go2.jpg";
maxPic = 2;
p1 = new Image (250,250);
p1.src = "image1.jpg";
link1 = "link1.html";
p2 = new Image (250,250);
p2.src = "image2.jpg";
link2 = "link2.html";
count = 1;
function next() {
count++;
if (count > maxPic) {
count = 1;
}
eval("document.p.src=p" + count + ".src");
}
function back() {
count--;
if (count == 0) {
count = maxPic;
}
eval("document.p.src=p" + count + ".src");
}
function link() {
location.href=eval("link" + count);
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
prev1 = new Image (50,50);
prev1.src = "Leftarrow.jpg";
prev2 = new Image (50,50);
prev2.src = "LeftarrowA.jpg";
next1 = new Image (50,50);
next1.src = "Rightarrow.jpg";
next2 = new Image (50,50);
next2.src = "RightarrowA.jpg";
go1 = new Image (145,95);
go1.src = "go.jpg";
go2 = new Image (145,95);
go2.src = "go2.jpg";
maxPic = 2;
p1 = new Image (250,250);
p1.src = "image1.jpg";
link1 = "link1.html";
p2 = new Image (250,250);
p2.src = "image2.jpg";
link2 = "link2.html";
count = 1;
function next() {
count++;
if (count > maxPic) {
count = 1;
}
eval("document.p.src=p" + count + ".src");
}
function back() {
count--;
if (count == 0) {
count = maxPic;
}
eval("document.p.src=p" + count + ".src");
}
function link() {
location.href=eval("link" + count);
}
// End -->
</script>