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
5 lines
2.0 KiB
/*! ResponsiveSlides.js v1.01. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ |
|
(function(a){a.fn.responsiveSlides=function(d){var b={speed:4E3,fade:1E3,auto:!0,maxwidth:"none",namespace:"rs"};return this.each(function(){var c=a(this);d&&a.extend(b,d);var f=function(){var a=parseFloat(b.maxwidth);d.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&c.each(function(){c.css("width","100%");c.width()>a?c.css("width",a):c.width()<a&&c.css("width","100%")})};(function(){var e=c.find("img"),d=a('<ul class="'+b.namespace+'_tabs" />'),g=parseFloat(b.fade),h={position:"relative", |
|
"float":"left"},f={position:"absolute","float":"none"};1>=c.find(e).length||(e.each(function(c){a(this).attr({id:b.namespace+"_s"+c})}),e.css({top:0,left:0,width:"100%",height:"inherit",position:"absolute"}),c.css({"max-width":parseFloat(b.maxwidth),width:"100%",overflow:"hidden",position:"relative"}),c.find(":first-child").css(h),c.find(e+":gt(0)").hide(),!0===b.auto?setInterval(function(){c.find(":first-child").fadeOut(g,function(){a(this).css(f)}).next(e).fadeIn(g,function(){a(this).css(h)}).end().appendTo(c)}, |
|
parseFloat(b.speed)):(e.each(function(a){a+=1;tabMarkup=["<li>",'<a href="#'+b.namespace+"_s"+a+'"','class="'+b.namespace+"_s"+a+'">'+a+"</a>","</li>"].join("");d.append(tabMarkup)}),c.after(d),c.find(":first-child").addClass(b.namespace+"_on"),a("."+b.namespace+"_s1").parent().addClass(b.namespace+"_here"),a("."+b.namespace+"_tabs a").each(function(c){var d=a(this);d.click(function(e){e.preventDefault();if(a("."+b.namespace+"_on:animated").length)return!1;d.parent().hasClass(b.namespace+"_here")||(a("."+b.namespace+"_tabs li").removeClass(b.namespace+ |
|
"_here"),a("."+b.namespace+"_on").stop().fadeOut(g,function(){a(this).removeClass(b.namespace+"_on").css(f)}).end(),a("#"+b.namespace+"_s"+c).stop().fadeIn(g,function(){a(this).addClass(b.namespace+"_on").css(h)}).end(),d.parent().addClass(b.namespace+"_here"))})})))})();f();a(window).resize(function(){f()})})}})(jQuery); |