// // 环形轮播图 $('.poster-list li').bind({ reposition: function() { var degrees = $(this).data('roundabout').degrees, roundaboutbearing = $(this).parent().data('roundabout').bearing, rotatey = math.sin((roundaboutbearing - degrees) * (math.pi/180)) * 9; $(this).css({ "-webkit-transform": 'rotate(' + rotatey + 'deg)', "-moz-transform": 'rotate(' + rotatey + 'deg)', "-ms-transform": 'rotate(' + rotatey + 'deg)', "-o-transform": 'rotate(' + rotatey + 'deg)', "transform": 'rotate(' + rotatey + 'deg)' }); } }); $('.jq_sliderprev').on('click', function(){ $('.poster-list').roundabout('animatetonextchild'); return false; }); $('.jq_slidernext').on('click', function(){ $('.poster-list').roundabout('animatetopreviouschild'); return false; }); $('body').on('keyup', function(e) { var keycode = e.which || e.keycode; if(keycode == 37) { $('.poster-list').roundabout('animatetopreviouschild'); e.preventdefault(); return false; } else if(keycode == 39) { $('.poster-list').roundabout('animatetonextchild'); e.preventdefault(); return false; } }); $('.jq_sliderswitch li').on('click', function() { var $elem = $(this); var index = $elem.index(); $('.poster-list').roundabout('animatetochild', index); return false; }); $('.poster-list').roundabout({ minscale: 0.4, maxscale: 0.9, duration: 750, autoplay: true, autoplayduration: 3000 }).bind({ animationend: function(e) { var index = $('.poster-list').roundabout('getchildinfocus'); $('.jq_sliderswitch li').removeclass('active'); $('.jq_sliderswitch li').eq(index).addclass('active'); } });