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.

5 lines
1.9 KiB

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