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
2.0 KiB

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