(function($){ $.fn.slide=function(options){ var opts = $.extend({},$.fn.slide.deflunt,options); var index=1; var targetli = $("." + opts.clanav + " li", $(this));//目标对象 var clicknext = $("." + opts.clanav + " .next", $(this));//点击下一个按钮 var clickprev = $("." + opts.clanav + " .prev", $(this));//点击上一个按钮 var contentbox = $("." + opts.clacon , $(this));//滚动的对象 var contentboxnum=contentbox.children().size();//滚动对象的子元素个数 var slideh=contentbox.children().first().height();//滚动对象的子元素个数高度,相当于滚动的高度 var slidew=contentbox.children().first().width();//滚动对象的子元素宽度,相当于滚动的宽度 var autoplay; var slidewh; if(opts.effect=="scrooly"||opts.effect=="scrooltxt"){ slidewh=slideh; }else if(opts.effect=="scroolx"||opts.effect=="scroolloop"){ contentbox.css("width",contentboxnum*slidew); slidewh=slidew; }else if(opts.effect=="fade"){ contentbox.children().first().css("z-index","1"); } return this.each(function() { var $this=$(this); //滚动函数 var doplay=function(){ $.fn.slide.effect[opts.effect](contentbox, targetli, index, slidewh, opts); index++; if (index*opts.steps >= contentboxnum) { index = 0; } }; clicknext.click(function(event){ $.fn.slide.effectloop.scroolleft(contentbox, targetli, index, slidewh, opts,function(){ for(var i=0;i