Browse Source

No more need to specify the namespace if you need more than one slideshow on the same page. Also, bumps up the version number to 1.05.

pull/10/merge
Viljami S 13 years ago
parent
commit
08246017ff
  1. 12
      responsiveslides.js
  2. 10
      responsiveslides.min.js

12
responsiveslides.js

@ -1,16 +1,16 @@
/*! ResponsiveSlides.js v1.04. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */
(function ($) {
/*! ResponsiveSlides.js v1.05. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */
(function ($, window, i) {
$.fn.responsiveSlides = function (options) {
// Settings
var settings = {
'speed' : 4000,
'fade' : 1000,
'auto' : true,
'maxwidth' : 'none',
'namespace' : 'rs'
'maxwidth' : 'none'
};
return this.each(function () {
i++;
var $this = $(this);
if (options) {
$.extend(settings, options);
@ -18,7 +18,7 @@
var slideshow = function () {
var $slide = $this.find('img'),
namespace = settings.namespace,
namespace = 'rslides' + i,
activeClass = namespace + '_here',
visibleClass = namespace + '_on',
slideClassPrefix = namespace + '_s',
@ -129,4 +129,4 @@
});
});
};
})(jQuery);
})(jQuery, this, 0);

10
responsiveslides.min.js vendored

@ -1,5 +1,5 @@
/*! ResponsiveSlides.js v1.04. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */
(function(a){a.fn.responsiveSlides=function(d){var c={speed:4E3,fade:1E3,auto:!0,maxwidth:"none",namespace:"rs"};return this.each(function(){var b=a(this);d&&a.extend(c,d);var g=function(){var a=parseFloat(c.maxwidth);d&&d.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()<a&&b.css("width","100%")})};(function(){var f=b.find("img"),e=c.namespace,d=e+"_here",h=e+"_on",i=e+"_s",k=e+"_tabs",e=a('<ul class="'+k+
'" />'),j=parseFloat(c.fade),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};if(1<b.find(f).length)if(f.each(function(a){this.id=i+a}),f.css({top:0,left:0,width:"100%",height:"inherit",position:"absolute"}),b.css({"max-width":parseFloat(c.maxwidth),width:"100%",overflow:"hidden",position:"relative"}).find(":first-child").css(l).end().find(f+":gt(0)").hide(),!0===c.auto)setInterval(function(){b.find(":first-child").fadeOut(j,function(){a(this).css(g)}).next(f).fadeIn(j,
function(){a(this).css(l)}).end().appendTo(b)},parseFloat(c.speed));else{var m="";f.each(function(a){a+=1;m+='<li><a href="#'+i+a+'"class="'+i+a+'">'+a+"</a></li>"});e.append(m);b.after(e).find(":first-child").addClass(h);a("."+i+"1").parent().addClass(d);a("."+k+" a").each(function(b){var c=a(this);c.click(function(e){e.preventDefault();if(a("."+h+":animated").length)return!1;c.parent().hasClass(d)||(a("."+k+" li").removeClass(d),a("."+h).stop().fadeOut(j,function(){a(this).removeClass(h).css(g)}).end(),
a("#"+i+b).stop().fadeIn(j,function(){a(this).addClass(h).css(l)}).end(),c.parent().addClass(d))})})}})();g();a(window).resize(function(){g()})})}})(jQuery);
/*! ResponsiveSlides.js v1.05. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */
(function(a,o,n){a.fn.responsiveSlides=function(d){var e={speed:4E3,fade:1E3,auto:!0,maxwidth:"none"};return this.each(function(){n++;var b=a(this);d&&a.extend(e,d);var g=function(){var a=parseFloat(e.maxwidth);d&&d.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()<a&&b.css("width","100%")})};(function(){var f=b.find("img"),c="rslides"+n,d=c+"_here",h=c+"_on",i=c+"_s",k=c+"_tabs",c=a('<ul class="'+k+'" />'),
j=parseFloat(e.fade),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};if(1<b.find(f).length)if(f.each(function(a){this.id=i+a}),f.css({top:0,left:0,width:"100%",height:"inherit",position:"absolute"}),b.css({"max-width":parseFloat(e.maxwidth),width:"100%",overflow:"hidden",position:"relative"}).find(":first-child").css(l).end().find(f+":gt(0)").hide(),!0===e.auto)setInterval(function(){b.find(":first-child").fadeOut(j,function(){a(this).css(g)}).next(f).fadeIn(j,function(){a(this).css(l)}).end().appendTo(b)},
parseFloat(e.speed));else{var m="";f.each(function(a){a+=1;m+='<li><a href="#'+i+a+'"class="'+i+a+'">'+a+"</a></li>"});c.append(m);b.after(c).find(":first-child").addClass(h);a("."+i+"1").parent().addClass(d);a("."+k+" a").each(function(b){var c=a(this);c.click(function(e){e.preventDefault();if(a("."+h+":animated").length)return!1;c.parent().hasClass(d)||(a("."+k+" li").removeClass(d),a("."+h).stop().fadeOut(j,function(){a(this).removeClass(h).css(g)}).end(),a("#"+i+b).stop().fadeIn(j,function(){a(this).addClass(h).css(l)}).end(),
c.parent().addClass(d))})})}})();g();a(o).resize(function(){g()})})}})(jQuery,this,0);
Loading…
Cancel
Save