Quantcast
Viewing all articles
Browse latest Browse all 28

Re: Can we get an example please ?

Amendment to the example code : change fire event from available to domready.
So example code would be :

<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/gallery-2010.10.20-19-33/build/gallery-carousel/assets/skins/sam/gallery-carousel
.css"/>
</head>
<body class="yui3-skin-sam">
<div class="carousel" id="container">
<ol>
<li><img src="http://static.flickr.com/5006/5265039009_f92b60ffc6_m.jpg"></li>
<li><img src="http://static.flickr.com/5163/5265038529_b35a4f497e_m.jpg"></li>
<li><img src="http://static.flickr.com/5008/5265644686_712fde3f34_m.jpg"></li>
<li><img src="http://static.flickr.com/5241/5265037365_8679d00d49_m.jpg"></li>
</ol>
</div>
</body>
<script type="text/javascript">
YUI({gallery: 'gallery-2010.10.20-19-33'}).use("gallery-carousel", "gallery-carousel-anim", "substitute", function(Y) {
Y.on("domready", function(e) {
var carousel = new Y.Carousel({ boundingBox: "#container", contentBox: "#container > ol"});
carousel.plug(Y.CarouselAnimPlugin,{animation:{speed: 0.7}});
carousel.render();
}, "#container");
});
</script>
</html>

Viewing all articles
Browse latest Browse all 28

Trending Articles