[ 13 posts ] Go to page 1, 2 Next

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile

Replay a yui carousel

Post Posted: Wed Feb 23, 2011 6:39 am
+0-
I am using the yui carousel 2.8 version and wanted to know how I could replay the slideshow after the last image.

I use 3 images and autoplay through them works fine. But, the autoplay stops after the last image.

How can I start playing it again?

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Wed Feb 23, 2011 11:08 am
+0-
Hello sjJNL.

See Setting up auto-play in Carousel section in the Carousel documentation [1].

var carousel = new YAHOO.widget.Carousel("container");
// Set the delay (in milliseconds) to automatically scroll
// the Carousel.
carousel.set("autoPlayInterval", 2000);
carousel.set("isCircular", true); // make the widget circular

Alternatively, you can set this property during the instantiation of Carousel itself.

var carousel = new YAHOO.widget.Carousel("container", {
autoPlayInterval: 2000,
isCircular: true
});

Hope that helps,
IceBox

P.S.: this is YUI 3.x forum not 2.x one.

[1] http://developer.yahoo.com/yui/carousel/

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Wed Feb 23, 2011 11:41 am
+0-
I had previously tried this and it worked but I also wanted to add animation setting to my carousel.

When I add all three , circular, autoplay and animation the last slide does not jump to the first slide in a circle but it goes backwards and the animation looked weird.

After researching through the forums, it is evident that animation does not work well with the other two settings and hence I though I can try to "REPLAY" or re-autoplay after the 3rd image.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Wed Feb 23, 2011 11:45 am
+0-
Hello sjJNL.

It would be better if you can share a test case (using a paste service).

Regards,
IceBox

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile
Tags:

Re: Replay a yui carousel

Post Posted: Wed Feb 23, 2011 2:12 pm
+0-
These are the attributes that I have used -

function init_carousel()

{

var carousel = new YAHOO.widget.Carousel("carouselcontainer",
{
numVisible: 1,
isCircular: true,
animation: { speed: 1 },
autoPlayInterval: 5000
}); // Create the carousel object


carousel.render(); // Let YUI set up its styles

carousel.startAutoPlay();

carousel.show(); // Finally, show the carousel

}


YAHOO.util.Event.onDOMReady(init_carousel);

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Wed Feb 23, 2011 2:14 pm
+0-
There is also a Ticket #2527684 out there to fix this issue in 2.9 release, I need a workaround before that comes out.

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Fri Mar 04, 2011 8:44 am
+0-
I updated my script a little to get the desired fade in fade out effect and removed animation from the config parameters.

But, the desired behavior deos not work in IE, it works fine in FF and Chrome.

Any ideas would help.

Here is my modified code -

function doFade() {
var container = document.getElementById("container");
YAHOO.util.Dom.setStyle(container, 'opacity', '0');
var ani = new YAHOO.util.Anim(container , {
opacity: {from: 0, to: 1 }
}, 7, YAHOO.util.Easing.easeOut);
ani.animate();
setInterval(doFade,7000);
}

function init_carousel()

{

var carousel = new YAHOO.widget.Carousel("container",
{
numVisible: 1,
isCircular: true,
autoPlayInterval: 7000,
//effect: { effect:YAHOO.widget.ContainerEffect.FADE, duration:0.30 }
//animation: { speed: 3, opacity: {from: 0, to: 1 }, effect: YAHOO.util.Easing.easeNone }
}); // Create the carousel object


carousel.render(); // Let YUI set up its styles

doFade(); // works in chrome & FF only

carousel.startAutoPlay();

//carousel.show(); // Finally, show the carousel

}


YAHOO.util.Event.onDOMReady(init_carousel);

Alberto Santini

YUI Contributor

  • Offline
  • Profile
Tags:

Re: Replay a yui carousel

Post Posted: Fri Mar 04, 2011 8:54 am
+1-
Hello sjJNL.

The trailing comma after autoPlayInterval affects IE behaviour.

Regards,
IceBox

sjJNL

  • Username: sjJNL
  • Joined: Thu Jul 08, 2010 6:58 am
  • Posts: 42
  • GitHub: sjJNL
  • Gists: sjJNL
  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Fri Mar 04, 2011 10:14 am
+0-
Unfortunately, removing teh comma did not fix the issue.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Replay a yui carousel

Post Posted: Fri Mar 04, 2011 10:41 am
+0-
Hello sjJNL.

I think it would be better if you may share the complete working snippet via a paste service.

Regards,
IceBox
  [ 13 posts ] Go to page 1, 2 Next
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum