(function($) { $.fn.poposlides = function(options) { var settings = $.extend({ auto:true, //自动播放 nav:true, //切换按钮 playspeed:5500, //自动播放速度 fadespeed:500, //淡入淡出速度 loop:true, //循环播放 pagination:true, //页码显示 pagecenter:true, //页码居中 prev:".prev", //上一页按钮 next:".next" //下一页按钮 }, options); return this.each(function() { var $this = $(this), slide = $this.children(), index = 0; len = slide.length-1, slidewidth = $this.width(), prev = settings.prev, next = settings.next; //初始隐藏其它页,显示当前页 if(!navigator.useragent.match(/mobile/i)){ slide.hide(); slide.eq(index).show(); }else{ slide.css({ "opacity":"0" }); slide.eq(index).css({ "opacity":"1" }); }; //显示当前页 slidefadein = function(){ if(!navigator.useragent.match(/mobile/i)){ slide.fadeout(settings.fadespeed); slide.eq(index).fadein(settings.fadespeed); }else{ slide.css({ "opacity":"0", "-webkit-transition": settings.fadespeed/1000+"s" }); slide.eq(index).css({ "opacity":"1", "-webkit-transition": settings.fadespeed/1000+"s" }); }; }; //翻页加,判断是否循环 slideadd = function() { if(settings.loop){ index == len?index=0:index++; }else{ index == len?index=len:index++; }; slidefadein(); }; //翻页减,判断是否循环 slideminus = function() { if(settings.loop){ index == 0?index=len:index--; }else{ index == 0?index=0:index--; }; slidefadein(); }; //页码 pagnation = function(){ var $paginationbox = $("