Viljami S
13 years ago
2 changed files with 5 additions and 2 deletions
@ -0,0 +1,5 @@
|
||||
/*! 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",nspace:"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.nspace+'_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.nspace+"_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.nspace+"_s"+a+'"','class="'+b.nspace+"_s"+a+'">'+a+"</a>","</li>"].join("");d.append(tabMarkup)}),c.after(d),c.find(":first-child").addClass(b.nspace+"_on"),a("."+b.nspace+"_s1").parent().addClass(b.nspace+"_here"),a("."+b.nspace+"_tabs a").each(function(c){var d=a(this);d.click(function(e){e.preventDefault();if(a("."+b.nspace+"_on:animated").length)return!1;d.parent().hasClass(b.nspace+"_here")||(a("."+b.nspace+"_tabs li").removeClass(b.nspace+ |
||||
"_here"),a("."+b.nspace+"_on").stop().fadeOut(g,function(){a(this).removeClass(b.nspace+"_on").css(f)}).end(),a("#"+b.nspace+"_s"+c).stop().fadeIn(g,function(){a(this).addClass(b.nspace+"_on").css(h)}).end(),d.parent().addClass(b.nspace+"_here"))})})))})();f();a(window).resize(function(){f()})})}})(jQuery); |
@ -1,2 +0,0 @@
|
||||
/*! ResponsiveSlides.js v1.01. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ |
||||
(function(a){a.fn.responsiveSlides=function(b){var c={speed:4e3,fade:1e3,auto:true,maxwidth:"none",namespace:"responsiveSlides"};return this.each(function(){var d=a(this);if(b){a.extend(c,b)}var e=function(){var b=d.find("img"),e=a('<ul class="'+c.namespace+'_tabs" />'),f={position:"relative","float":"left"},g={position:"absolute","float":"none"};if(d.find(b).length<=1){return}b.each(function(b){var d=a(this);d.attr({id:c.namespace+"_slide"+b})});b.css({top:0,left:0,width:"100%",height:"inherit",position:"absolute"});d.find(":first-child").addClass(c.namespace+"_visible").css(f);d.css({"max-width":parseFloat(c.maxwidth),width:"100%",overflow:"hidden",position:"relative"});d.find(b+":gt(0)").hide();if(c.auto===true){setInterval(function(){d.find(":first-child").fadeOut(parseFloat(c.fade),function(){a(this).css(g)}).next(b).fadeIn(parseFloat(c.fade),function(){a(this).css(f)}).addClass(c.namespace+"_visible").end().appendTo(d).removeClass(c.namespace+"_visible")},parseFloat(c.speed))}else{b.each(function(a){var b=a+1;tabMarkup=["<li>",'<a href="#'+c.namespace+"_slide"+b+'"','class="'+c.namespace+"_slide"+b+'">'+b+"</a>","</li>"].join("");e.append(tabMarkup)});d.after(e);a("."+c.namespace+"_slide1").parent().addClass(c.namespace+"_active");a("."+c.namespace+"_tabs a").each(function(b){var d=a(this);d.click(function(e){e.preventDefault();if(a("."+c.namespace+"_visible:animated").length){return false}if(!d.parent().hasClass(c.namespace+"_active")){a("."+c.namespace+"_tabs li").removeClass(c.namespace+"_active");a("."+c.namespace+"_visible").stop().fadeOut(parseFloat(c.fade),function(){a(this).removeClass(c.namespace+"_visible").css(g)}).end();a("#"+c.namespace+"_slide"+b).stop().fadeIn(parseFloat(c.fade),function(){a(this).addClass(c.namespace+"_visible").css(f)}).end();d.parent().addClass(c.namespace+"_active")}})})}};var f=function(){if(b.maxwidth){if(typeof document.body.style.maxHeight!=="undefined"&&typeof document.body.style.minHeight!=="undefined"){return false}else{d.each(function(){d.css("width","100%");if(d.width()>parseFloat(c.maxwidth)){d.css("width",parseFloat(c.maxwidth))}else if(d.width()<parseFloat(c.maxwidth)){d.css("width","100%")}})}}};e();f();a(window).resize(function(){f()})})}})(jQuery); |
Loading…
Reference in new issue