|
|
|
/*! http://responsive-slides.viljamis.com v1.22 by @viljamis */
|
|
|
|
(function(c,A,t){c.fn.responsiveSlides=function(m){var b=c.extend({auto:!0,pagination:!1,nav:!1,prevText:"Previous",nextText:"Next",fade:1E3,maxwidth:"none",speed:4E3,namespace:"rslides"},m);return this.each(function(){t++;var e=c(this),i=0,f=e.children(),u=f.size(),v=parseFloat(b.fade),g=b.namespace,d=g+t,n=g+" "+d,o=g+"_here",h=d+"_on",w=d+"_s",p=c('<ul class="'+g+"_tabs "+(d+"_tabs")+'" />'),x={"float":"left",position:"relative"},B={"float":"none",position:"absolute"},j=function(a){e.trigger(g+
|
|
|
|
"-before");f.stop().fadeOut(v,function(){c(this).removeClass(h).css(B)}).eq(a).fadeIn(v,function(){c(this).addClass(h).css(x).trigger(g+"-after");i=a})};if(1<f.size()){f.each(function(a){this.id=w+a});e.css("max-width",b.maxwidth).addClass(n);f.hide().eq(0).addClass(h).css(x).show();if(!0===b.pagination){var k=[];f.each(function(a){a+=1;k.push("<li>");k.push('<a href="#" class="'+w+a+'">'+a+"</a>");k.push("</li>")});p.append(k.join(""));var q=p.find("a");e.after(p)}var l=function(a){q.closest("li").removeClass(o).eq(a).addClass(o)};
|
|
|
|
if(!0===b.auto){var r,y;r=function(){y=setInterval(function(){var a=i+1<u?i+1:0;!0===b.pagination&&l(a);j(a)},parseFloat(b.speed))};r()}var s=function(){!0===b.auto&&(clearInterval(y),r())};!0===b.pagination&&q.on("click",function(a){a.preventDefault();s();a=q.index(this);if(i!==a){if(c("."+h+":animated").length)return!1;l(a);j(a)}}).eq(0).closest("li").addClass(o)}!0===b.nav&&(e.after('<a href="#" title="'+b.prevText+'" class="'+g+"_nav "+d+'_nav prev">'+b.prevText+'</a><a href="#" title="'+b.nextText+
|
|
|
|
'" class="'+g+"_nav "+d+'_nav next">'+b.nextText+"</a>"),n=c("."+d+"_nav.prev"),d=c("."+d+"_nav.next"),n.on("click",function(a){a.preventDefault();a=f.index(c("."+h))-1;if(c("."+h+":animated").length)return!1;s();j(a);!0===b.pagination&&l(a)}),d.on("click",function(a){a.preventDefault();a=f.index(c("."+h))+1<u?i+1:0;if(c("."+h+":animated").length)return!1;s();j(a);!0===b.pagination&&l(a)}));if("undefined"===typeof document.body.style.maxWidth&&m&&m.maxwidth){var z=function(){e.css("width","100%");
|
|
|
|
e.width()>b.maxwidth&&e.css("width",b.maxwidth)};z();c(A).on("resize",function(){z()})}})}})(jQuery,this,0);
|