Results 1 to 4 of 4

Thread: Fade time in Swiss Army Slideshow

  1. #1
    Join Date
    Jan 2006
    Location
    Gallatin Gateway, Montana
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fade time in Swiss Army Slideshow

    1) Script Title: Swiss Army Slideshow

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...army/index.htm


    3) Describe problem: How can I increase/decrease fade delay between images? Thanx in advance for any help.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use the delay property of the array:

    slides.delay=3000
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Location
    Gallatin Gateway, Montana
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, I didn't make myself clear. I'm trying to lengthen/shorten the fade time itself, not the display time of the images.

    Robin

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, there are two spots in swissarmy.js where this is controlled (red):

    Code:
    inter_slide.prototype.fadepic=function(){
    if (this.fade&&this.degree<100){
    this.faded=0
    this.degree+=10
    if (this.tempobj.filters&&this.tempobj.filters[0]){
    if (typeof this.tem . . .
    which controls how much of an opacity increase you get each time this (blue & red):

    Code:
     . . . umperidx=this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1;
    var fadeobj=this
    clearInterval(this.fadeclear)
    this.fadeclear=setInterval(function(){fadeobj.fadepic()},50)
    this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
    }
    else{
    var v4imgobj=document.images['defaultslide'+this.issid]
    v4imgobj.src=this.postimgs[this.nextimgidx].src
    this.nextimgidx=(this.nextimgidx<this.imgs.length-1)? this.nextimgidx+1 : 0
    }
    }
    
    inter_slide.prototype.resetit=function(){
    this.degree=10
    var crossobj=this.go(this.cu . . .
    fires. You can play with the numbers to get what you like.

    I believe that the first value (currently 10) must be an even divisor of 100 like 1, 2, 5, 10, 20, 25, 50 and that only 2, 5, and 10, possibly 20, are of any practical use. The larger this number is, the greater the opacity increases with each iteration controlled by the other value.

    The second value controls how often this opacity increase is applied during the fade-in. It represents milliseconds. The larger it is, the more time passes between each incremental increase. It shouldn't be less than 20, though newer machines and some browsers can handle very small values.

    If you are lengthening the time of fade-in, you may reach a point where the total time needed to fade-in is greater than the interval between images. If so, the image will not fade all the way in and there could be other problems. If this happens, you can increase the delay property of the array as mentioned in my previous post.

    Now, if you want to break it out to control these values individually for each slide show, they can be changed to:

    Code:
    this.degree+=this.imgs.dc
    and:

    Code:
    this.fadeclear=setInterval(function(){fadeobj.fadepic()},this.imgs.fr)
    respectively. And, then be made properties of the array:

    Code:
    slides.dc=10;
    slides.fr=50;
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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