Mad_Dan
02-05-2007, 05:39 AM
Hi guys,
I have a slideshow script from codelifter, and I would like to add function buttons. I would like, play/pause, previous, next, first and last.
here is the script:
var SlideShowSpeed = 4000;
var CrossFadeDuration = 3;
var Picture = new Array();
var Caption = new Array();
Picture[1] = 'index_slideshow_pics/great_white_dark.jpg';
Picture[2] = 'index_slideshow_pics/great_white.jpg';
Picture[3] = 'index_slideshow_pics/pella.jpg';
Picture[4] = 'index_slideshow_pics/pella_rear.jpg';
Picture[5] = 'index_slideshow_pics/pella_wake.jpg';
Picture[6] = 'index_slideshow_pics/5_gummys_on_deck.jpg';
Picture[7] = 'index_slideshow_pics/dan_holding_gummy.jpg';
Picture[8] = 'index_slideshow_pics/ollie_holding_gummy.jpg';
Picture[9] = 'index_slideshow_pics/greg_bronzie.jpg';
Picture[10] = 'index_slideshow_pics/pink_snapper.jpg';
Caption[1] = "The Great White Shark.";
Caption[2] = "Also known as a White Pointer.";
Caption[3] = "Shawns boat Pella.";
Caption[4] = "Pella moored at Emu Bay.";
Caption[5] = "Cruising out To sea in Pella.";
Caption[6] = "A few Gummy sharks on deck.";
Caption[7] = "Dan Holding a Gummy shark.";
Caption[8] = "Ollie Holding another Gummy shark.";
Caption[9] = "Bullfrog with a 70 kilo Bronze Whaler Shark.";
Caption[10] = "A small Pink Snapper.";
var tss;
var iss;
var jss = 1;
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 runSlideShow()
{
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;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}
I was hoping someone could show me the script needed to make these buttons function from the already existing js script. The script is in an external .js file
I think I can write the html script in the body ( thats how noobie I am, I hope i can write the html, lol).
I have only just recently experimented with HTML, XHTML, CSS and JS, at W3schools, LOL.
I was hoping that once I see the correct code in front of me I may grasp JS a little bit better.
Thanks in advance to anyone who would like to contribute some ideas.
I apologise if this is the incorrect way to post a script or if its too long, so feel free to let me know :-)
I have a slideshow script from codelifter, and I would like to add function buttons. I would like, play/pause, previous, next, first and last.
here is the script:
var SlideShowSpeed = 4000;
var CrossFadeDuration = 3;
var Picture = new Array();
var Caption = new Array();
Picture[1] = 'index_slideshow_pics/great_white_dark.jpg';
Picture[2] = 'index_slideshow_pics/great_white.jpg';
Picture[3] = 'index_slideshow_pics/pella.jpg';
Picture[4] = 'index_slideshow_pics/pella_rear.jpg';
Picture[5] = 'index_slideshow_pics/pella_wake.jpg';
Picture[6] = 'index_slideshow_pics/5_gummys_on_deck.jpg';
Picture[7] = 'index_slideshow_pics/dan_holding_gummy.jpg';
Picture[8] = 'index_slideshow_pics/ollie_holding_gummy.jpg';
Picture[9] = 'index_slideshow_pics/greg_bronzie.jpg';
Picture[10] = 'index_slideshow_pics/pink_snapper.jpg';
Caption[1] = "The Great White Shark.";
Caption[2] = "Also known as a White Pointer.";
Caption[3] = "Shawns boat Pella.";
Caption[4] = "Pella moored at Emu Bay.";
Caption[5] = "Cruising out To sea in Pella.";
Caption[6] = "A few Gummy sharks on deck.";
Caption[7] = "Dan Holding a Gummy shark.";
Caption[8] = "Ollie Holding another Gummy shark.";
Caption[9] = "Bullfrog with a 70 kilo Bronze Whaler Shark.";
Caption[10] = "A small Pink Snapper.";
var tss;
var iss;
var jss = 1;
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 runSlideShow()
{
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;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}
I was hoping someone could show me the script needed to make these buttons function from the already existing js script. The script is in an external .js file
I think I can write the html script in the body ( thats how noobie I am, I hope i can write the html, lol).
I have only just recently experimented with HTML, XHTML, CSS and JS, at W3schools, LOL.
I was hoping that once I see the correct code in front of me I may grasp JS a little bit better.
Thanks in advance to anyone who would like to contribute some ideas.
I apologise if this is the incorrect way to post a script or if its too long, so feel free to let me know :-)