| Page 1 of 2 | [ 13 posts ] | Go to page 1, 2 Next |
|
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 SantiniYUI Contributor
|
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/ |
|
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 SantiniYUI Contributor
|
Hello sjJNL.
It would be better if you can share a test case (using a paste service). Regards, IceBox |
|
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); |
|
There is also a Ticket #2527684 out there to fix this issue in 2.9 release, I need a workaround before that comes out.
|
|
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 SantiniYUI Contributor
|
Hello sjJNL.
The trailing comma after autoPlayInterval affects IE behaviour. Regards, IceBox |
|
Unfortunately, removing teh comma did not fix the issue.
|
Alberto SantiniYUI Contributor
|
Hello sjJNL.
I think it would be better if you may share the complete working snippet via a paste service. Regards, IceBox |
| Page 1 of 2 | [ 13 posts ] | Go to page 1, 2 Next |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group