jquery.roundabout - 图片倾斜效果幻灯片带箭头和索引

下载地址

相关js代码$(document).ready(function(){ $("#img-slider 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(){ $("#img-slider").roundabout("animateToNextChild"); return false; }); $(".jQ_sliderNext").on("click", function(){ $("#img-slider").roundabout("animateToPreviousChild"); return false; }); $("body").on("keyup", function(e) { var keyCode = e.which || e.keyCode; if(keyCode == 37) { $("#img-slider").roundabout("animateToPreviousChild"); e.preventDefault(); return false; } else if(keyCode == 39) { $("#img-slider").roundabout("animateToNextChild"); e.preventDefault(); return false; } }); $(".jQ_sliderSwitch li").on("click", function() { var $elem = $(this); var index = $elem.index(); $("#img-slider").roundabout("animateToChild", index); return false; }); $("#img-slider").roundabout({ minScale: 0.4, maxScale: 0.9, duration: 750 }).bind({ animationEnd: function(e) { var index = $("#img-slider").roundabout("getChildInFocus"); $(".jQ_sliderSwitch li").removeClass("active"); $(".jQ_sliderSwitch li").eq(index).addClass("active"); } });});

7b5d0ccd08facf58f40fa4dd17f7c96d4283.png

dd:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值