Results 1 to 7 of 7

Thread: fadeshow STOP?

  1. #1
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default fadeshow STOP?

    1) Script Title: fadeshow

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



    Can I stop fadeshow at anytime? Lets say I have fadeshow in the [ div ] and contents of this [ div ] must be replaced with something else - but before that I need to stop fadeshow. Otherwise I get JS errors.

    Thank you.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it doesn't look like original script at all it's too modified...

    just need to stop original fadeshow script with javascript, that's all.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It is highly modified, but definitely for the better. The controls can be hidden with CSS, if you so desire. More importantly, the event on the "Stop" button demonstrates how to halt it with script.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes, twey, I tried your code, it's completely different, of course anyway, it doesn't work on my page for some reason (says stopstart() is not a function) and it has much of the functionality I don't need. it does work as standalone though...

    is there's a way the original code could be modified to have some function like stop() where slideshow could be stopped? I don't compleletely understand the code, it's too complicated for my JS understanding.

    No?

  6. #6
    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

    Quote Originally Posted by encrypted View Post
    1) Script Title: fadeshow

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



    Can I stop fadeshow at anytime? Lets say I have fadeshow in the [ div ] and contents of this [ div ] must be replaced with something else - but before that I need to stop fadeshow. Otherwise I get JS errors.

    Thank you.
    Modify the script here (in function fadeshow()):

    Code:
    if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
    this.startit()
    else{
    this.curimageindex++
    setInterval("if(fadearray){fadearray["+this.slideshowid+"].rotateimage()}", this.delay)
    here:

    Code:
    function fadepic(obj){
    if (obj.degree<100){
    obj.degree+=10
    if (obj.tempobj.filters&&obj.tempobj.filters[0]){
    if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
    obj.tempobj.filters[0].opacity=obj.degree
    else //else if IE5.5-
    obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
    }
    else if (obj.tempobj.style.MozOpacity)
    obj.tempobj.style.MozOpacity=obj.degree/101
    else if (obj.tempobj.style.KhtmlOpacity)
    obj.tempobj.style.KhtmlOpacity=obj.degree/100
    }
    else{
    clearInterval(fadeclear[obj.slideshowid])
    obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
    obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
    obj.populateslide(obj.tempobj, obj.nextimageindex)
    obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
    if(fadearray)
    setTimeout("if(fadearray){fadearray["+obj.slideshowid+"].rotateimage()}", obj.delay)
    }
    }
    and here (in fadeshow.prototype.rotateimage=function()):

    Code:
    fadeclear[this.slideshowid]=setInterval("if(fadearray){fadepic(fadearray["+this.slideshowid+"])}",50)
    Then you can stop all slide shows on a page with this:

    Code:
    fadearray=null;
    - John
    ________________________

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

  7. #7
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you, jscheuer1, so much!

    Everything works.

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
  •