You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
2.4 KiB
6 lines
2.4 KiB
/*! http://responsiveslides.com v1.32 by @viljamis */ |
|
(function(d,E,w){d.fn.responsiveSlides=function(h){var b=d.extend({auto:!0,speed:1E3,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!1,prevText:"Previous",nextText:"Next",maxwidth:"",controls:"",namespace:"rslides",before:function(){},after:function(){}},h);return this.each(function(){w++;var e=d(this),n,q,i,k,l,m=0,f=e.children(),x=f.size(),r=parseFloat(b.speed),y=parseFloat(b.timeout),s=parseFloat(b.maxwidth),c=b.namespace,g=c+w,z=c+"_nav "+g+"_nav",t=c+"_here",j=g+"_on",A=g+"_s", |
|
p=d("<ul class='"+c+"_tabs "+g+"_tabs' />"),B={"float":"left",position:"relative"},F={"float":"none",position:"absolute"},u=function(a){b.before();f.stop().fadeOut(r,function(){d(this).removeClass(j).css(F)}).eq(a).fadeIn(r,function(){d(this).addClass(j).css(B);b.after();m=a})};b.random&&(f.sort(function(){return Math.round(Math.random())-0.5}),e.empty().append(f));f.each(function(a){this.id=A+a});e.addClass(c+" "+g);h&&h.maxwidth&&e.css("max-width",s);f.hide().eq(0).addClass(j).css(B).show();if(1< |
|
f.size()){if(y<r+100)return;if(b.pager){var v=[];f.each(function(a){a+=1;v+="<li><a href='#' class='"+A+a+"'>"+a+"</a></li>"});p.append(v);l=p.find("a");h.controls?d(b.controls).append(p):e.after(p);n=function(a){l.closest("li").removeClass(t).eq(a).addClass(t)}}b.auto&&(q=function(){k=setInterval(function(){f.stop(!0,!0);var a=m+1<x?m+1:0;b.pager&&n(a);u(a)},y)},q());i=function(){b.auto&&(clearInterval(k),q())};b.pause&&e.hover(function(){clearInterval(k)},function(){i()});b.pager&&(l.bind("click", |
|
function(a){a.preventDefault();b.pauseControls||i();a=l.index(this);m===a||d("."+j).queue("fx").length||(n(a),u(a))}).eq(0).closest("li").addClass(t),b.pauseControls&&l.hover(function(){clearInterval(k)},function(){i()}));if(b.nav){c="<a href='#' class='"+z+" prev'>"+b.prevText+"</a><a href='#' class='"+z+" next'>"+b.nextText+"</a>";h.controls?d(b.controls).append(c):e.after(c);var c=d("."+g+"_nav"),C=d("."+g+"_nav.prev");c.bind("click",function(a){a.preventDefault();if(!d("."+j).queue("fx").length){var c= |
|
f.index(d("."+j)),a=c-1,c=c+1<x?m+1:0;u(d(this)[0]===C[0]?a:c);b.pager&&n(d(this)[0]===C[0]?a:c);b.pauseControls||i()}});b.pauseControls&&c.hover(function(){clearInterval(k)},function(){i()})}}if("undefined"===typeof document.body.style.maxWidth&&h.maxwidth){var D=function(){e.css("width","100%");e.width()>s&&e.css("width",s)};D();d(E).bind("resize",function(){D()})}})}})(jQuery,this,0); |