类似水车旋转的图片组 banner
本例不支持鼠标滚动的,图片的透明度递减
XML/HTML Code
- <div id="carousel">
- <img src="images/1.jpg" id="item-1" />
- <img src="images/2.jpg" id="item-2" />
- <img src="images/3.jpg" id="item-3" />
- <img src="images/4.jpg" id="item-4" />
- <img src="images/5.jpg" id="item-5" />
- <img src="images/6.jpg" id="item-6" />
- <img src="images/7.jpg" id="item-7" />
- <img src="images/8.jpg" id="item-8" />
- <img src="images/9.jpg" id="item-9" />
- </div>
JavaScript Code
- <script type="text/javascript">
- $(document).ready(function () {
- var carousel = $("#carousel").waterwheelCarousel({
- flankingItems: 3,
- movingToCenter: function ($item) {
- $('#callback-output').prepend('movingToCenter: ' + $item.attr('id') + '<br/>');
- },
- movedToCenter: function ($item) {
- $('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>');
- },
- movingFromCenter: function ($item) {
- $('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>');
- },
- movedFromCenter: function ($item) {
- $('#callback-output').prepend('movedFromCenter: ' + $item.attr('id') + '<br/>');
- },
- clickedCenter: function ($item) {
- $('#callback-output').prepend('clickedCenter: ' + $item.attr('id') + '<br/>');
- }
- });
- $('#prev').bind('click', function () {
- carousel.prev();
- return false
- });
- $('#next').bind('click', function () {
- carousel.next();
- return false;
- });
- $('#reload').bind('click', function () {
- newOptions = eval("(" + $('#newoptions').val() + ")");
- carousel.reload(newOptions);
- return false;
- });
- });
- </script>
原文地址:http://www.freejs.net/article_jquerytupiantexiao_336.html