$(function() {
$(".picchange").picchange({
button : "dot"
}); //使用默认效果
//参数参考
$(".piclist").picchange({
//动画效果,共21种,加入编号进入数组,默认所有效果随机播放,
// 0 淡入淡出,1 放大,2 缩小,
// 3 左移,4 右移,5 上移,6 下移,
// 7 左入,8 右入,9 上入,10 下入,
// 11 x轴翻转,12 y轴翻转,
// 13 左翻页,14 右翻页,15 上翻页,16 下翻页,
// 17 左3d旋转,18 右3d旋转,19 上3d旋转,20 下3d旋转
effect : [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],
delaytime : 5000, //背景图片切换间隔时间,默认 5000(毫秒)
button : "pic", //显示按钮, "pic"图片按钮(默认)|"num"数字页码|"dot"点|"news"新闻按钮
animationtime : 1.2, //动画播放时间单位秒
timingfunction : "ease", //缓动效果,默认"ease",使用css缓动参数
leftarrowanimation: 3, //左箭头动画效果,默认随机
rightarrowanimation : 4, //右箭头动画效果,默认随机
});
});
/*
picchange 2.00 图片切换
copyright (c) 2020 zhibinpu
email: puzhibin@hotmail.com
date: 2020-3-17
jquery-1.12.4.min.js
update: 2020-3-17
*/
(function(a){a.fn.picchange=function(j){var p={delaytime:5000,effect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],button:"pic",animationtime:1.2,timingfunction:"ease",leftarrowanimation:-1,rightarrowanimation:-1,};var j=a.extend(p,j);var e={interval:null,isrun:false,};var a=this;var l,o;var g={};var y=[];var f=0;var v=0;var c=["eade","zoombig","zoomsmall","moveleft","moveright","moveup","movedown","slideleft","slideright","slideup","slidedown","flipx","flipy","flipleft","flipright","flipup","flipdown","rollleft","rollright","rollup","rolldown",];(function(){k();w();u();d();m();s();q()})();function k(){a.find("li").each(function(){var d=a(this).find("img");var e=d.attr("src");if(e!="/"&&e!=""&&e!=undefined){var c={};c.src=e;c.title=a(this).find(".name").text();c.time=a(this).find(".time").text();c.href=a(this).find("a").attr("href");y.push(c)}});a.empty()}function w(){a.append(function(){cont='
';for(i=0;i
'}else{cont+=''}}cont+="";return cont});l=a.find(".piclist > div");l.eq(0).addclass("show")}function m(){a.append(function(){cont='';for(i=0;i';break;case"dot":cont+="";break;case"num":cont+="- "+(i+1)+"
";break;case"news":cont+=''+y[i].title+'
'+y[i].time+"
";break;default:break}}cont+="";return cont});o=a.find(".btnlist > li");o.eq(0).addclass("act")}function s(){a.append('<>
');g.$left=a.find(".btnleft");g.$right=a.find(".btnright")}function h(c){if(c==-1){var c=j.effect[math.floor(math.random()*j.effect.length)]}l.eq(v).addclass("show next").css({"animation":c[c]+"in "+j.animationtime+"s "+j.timingfunction,"backface-visibility":"hidden",});l.eq(f).addclass("show now").css({"animation":c[c]+"out "+j.animationtime+"s "+j.timingfunction,"backface-visibility":"hidden",});switch(c[c]){case"rollup":case"rolldown":var d=(a(".piclist").height()/2*-1)+"px";l.eq(v).css({"transform-origin":"50% 50% "+d});l.eq(f).css({"transform-origin":"50% 50% "+d});break;case"rollleft":case"rollright":var d=(a(".piclist").width()/2*-1)+"px";l.eq(v).css({"transform-origin":"50% 50% "+d});l.eq(f).css({"transform-origin":"50% 50% "+d});break;default:break}o.removeclass();o.eq(v).addclass("act")}function r(){l.css({"transform-origin":"","animation":"","z-index":"",})}function d(){a.on("animationstart",".next",function(){t();n()});a.on("animationend",".next",function(){l.removeclass();a(this).addclass("show");f=v;q();u();r()})}function u(){if(e.isrun==false){e.interval=setinterval(z,j.delaytime);e.isrun=true}}function n(){clearinterval(e.interval);e.isrun=false}function q(){o.bind("click",b);g.$left.bind("click",x);g.$right.bind("click",z)}function t(){o.unbind("click");g.$left.unbind("click",x);g.$right.unbind("click",z)}function b(){if(v!=a(this).index()){v=a(this).index();b();h(-1)}}function z(){v=v+1;b();h(j.rightarrowanimation)}function x(){v=v-1;b();h(j.leftarrowanimation)}function b(){if(v>y.length-1){v=0}if(v<0){v=y.length-1}}}})(jquery);