Current location: Hot Scripts Forums » General Web Coding » JavaScript » Need help to modify slide show script


Need help to modify slide show script

Reply
  #1 (permalink)  
Old 09-14-05, 09:57 AM
sleph sleph is offline
New Member
 
Join Date: Sep 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Need help to modify slide show script

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
Reply With Quote
  #2 (permalink)  
Old 09-16-05, 06:16 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Here's what the script could look like:
Code:
<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")
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
  #3 (permalink)  
Old 09-16-05, 08:59 PM
sleph sleph is offline
New Member
 
Join Date: Sep 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanx for that TwoD,

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....
Reply With Quote
  #4 (permalink)  
Old 09-17-05, 12:55 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, try changing:
Code:
document.images.PictureBox.onclick = new Function("window.open("+Target[jss]+")");
to
Code:
document.images.PictureBox.onclick = new Function("window.open('"+Target[jss]+"')");
Added single quotation marks where the URL is inserted, maybe it fixes the problem.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
  #5 (permalink)  
Old 09-19-05, 05:18 AM
sleph sleph is offline
New Member
 
Join Date: Sep 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanx TwoD...that did the trick....you're a legend!!!
email me a link and I'll put a credit in the header.

cheers
Sleph
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 07:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
onLoad script not to show the address toolbar ExoticCarSite Script Requests 1 01-03-05 06:19 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 12:12 AM
Need help on a image slide show using php! xelanoimis PHP 2 10-16-03 06:51 PM


All times are GMT -5. The time now is 10:54 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.