I'm a newbie to scripting and need some help.
I used a script for an "advanced push button slide show" on my website and would like to add some script so that you can click on a picture in the slideshow to take you to a another page.(ie click on a picture of a website to launch a new window to that site) Any script that I add to achieved this seems to render the slide show script inoperative. If anyone can help with this I'd be very greatful. web address is: http://www.247media.com.au/web.htm
<script>
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.
// ==============================
// Set the following variables...
// ==============================
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;
// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 2;
var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false; // don't change this
var Target = new Array();
// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!
Picture[1] = 'images/web_im1.jpg';
Picture[2] = 'images/web_im2.jpg';
Picture[3] = 'images/web_im3.jpg';
Picture[4] = 'images/web_im4.jpg';
// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!
Caption[1] = "www.rockonforlife.org";
Caption[2] = "www.joelmsmusic.com";
Caption[3] = "www.samburke.net";
Caption[4] = "www.garyjohns.com";
// Specify the links...
Target[1] = "http://www.rockonforlife.org";
Target[2] = "http://www.joelmsmusic.com";
Target[3] = "http://www.samburke.net";
Target[4] = "http://www.garyjohns.com";
// =====================================
// Do not edit anything below this line!
// =====================================
var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;
var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}
function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
document.images.PictureBox.onclick = new Function("window.open("+Target[jss]+")");
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss]; // Change to "<a onclick='window.open(\'"+Target[jss]+"\')'>"+Caption[jss]+"</a>"; if you want the text to be clickable too.
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
This opens a new window with the default browser settings (just as if the visitor clicks "open in a new window")
It certainly looks better than my attempt, and doesn't stop the slide show from operating but doesn't seem to work either. I checked in Safari and Opera with no result and IE gives me an error...expected')'...which I tried to no effect....