Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Slideshow Script

    Here is my slide show script, although if the 'next' and 'previous' buttons aren't being pressed I want the image and the text to rotate to the next image or caption every 3 seconds, anyone able to modify my code to do this?


    var SlideShowSpeed = 3000;
    var CrossFadeDuration = 2;

    var Picture = new Array();
    var Caption = new Array();
    var showHot = false;

    Picture[1] = 'images/slideshow1.jpg';
    Picture[2] = 'images/slideshow2.jpg';
    Picture[3] = 'images/slideshow3.jpg';

    Caption[1] = "Here you will enter your description for Portfolio Photo #1!";
    Caption[2] = "Here you will enter your description for Portfolio Photo #2!";
    Caption[3] = "Here you will enter your description for Portfolio Photo #3!";

    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 control(how){
    if (showHot){
    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=1)";
    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();
    }}

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    You have something called slideshowspeed. Where is it being used? Did you intend to call "control" with setInterval perhaps, or setting and calling again each time, setTimeout?

    Check out the Curry thread in 'post-a-javascript'. The second message shows an easy way to trigger an 'animation' loop.

  • #3
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Slideshow speed controls the speed the various images fade in and out when the 'next' or 'previous' buttons are clicked, will do... cheers!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •