From 89130ba128689712d8860eb28e8160cbbdc42e3d Mon Sep 17 00:00:00 2001 From: Viljami S Date: Mon, 19 Dec 2011 17:14:24 +0200 Subject: [PATCH] * Fixes problems when using ResponsiveSlides.js with other jQuery plugins. * Makes the tabMarkup minify better. * Bump up the version number to 1.04. --- responsiveslides.js | 15 +++++++-------- responsiveslides.min.js | 10 +++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/responsiveslides.js b/responsiveslides.js index b6fb2df..79ec9f4 100644 --- a/responsiveslides.js +++ b/responsiveslides.js @@ -1,4 +1,4 @@ -/*! ResponsiveSlides.js v1.03. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ +/*! ResponsiveSlides.js v1.04. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ (function ($) { $.fn.responsiveSlides = function (opts) { // Settings @@ -72,12 +72,11 @@ $slide.each(function (i) { var n = i + 1; - tabMarkup += [ - '
  • ', - '' + n + '', - '
  • ' - ].join(''); + tabMarkup += + '
  • ' + + '' + n + '' + + '
  • '; }); $pagination.append(tabMarkup); @@ -111,7 +110,7 @@ // Fallback to make IE6 support CSS max-width var widthSupport = function () { var maxwidth = parseFloat(settings.maxwidth); - if (opts.maxwidth) { + if (opts && opts.maxwidth) { if (typeof document.body.style.maxHeight === 'undefined') { $this.each(function () { $this.css('width', '100%'); diff --git a/responsiveslides.min.js b/responsiveslides.min.js index d362170..3fd55c7 100644 --- a/responsiveslides.min.js +++ b/responsiveslides.min.js @@ -1,5 +1,5 @@ -/*! ResponsiveSlides.js v1.03. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ -(function(a){a.fn.responsiveSlides=function(e){var c={speed:4E3,fade:1E3,auto:!0,maxwidth:"none",namespace:"rs"};return this.each(function(){var b=a(this);e&&a.extend(c,e);var g=function(){var a=parseFloat(c.maxwidth);e.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()'), -k=parseFloat(c.fade),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};1>=b.find(f).length||(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"}),b.find(":first-child").css(l),b.find(f+":gt(0)").hide(),!0===c.auto?setInterval(function(){b.find(":first-child").fadeOut(k,function(){a(this).css(g)}).next(f).fadeIn(k,function(){a(this).css(l)}).end().appendTo(b)}, -parseFloat(c.speed)):(tabMarkup="",f.each(function(a){a+=1;tabMarkup+=["
  • ",''+a+"","
  • "].join("")}),d.append(tabMarkup),b.after(d).find(":first-child").addClass(h),a("."+i+"1").parent().addClass(j),a("."+e+" a").each(function(b){var c=a(this);c.click(function(d){d.preventDefault();if(a("."+h+":animated").length)return!1;c.parent().hasClass(j)||(a("."+e+" li").removeClass(j),a("."+h).stop().fadeOut(k,function(){a(this).removeClass(h).css(g)}).end(),a("#"+ -i+b).stop().fadeIn(k,function(){a(this).addClass(h).css(l)}).end(),c.parent().addClass(j))})})))})();g();a(window).resize(function(){g()})})}})(jQuery); \ No newline at end of file +/*! ResponsiveSlides.js v1.04. (c) 2011 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()'),j=parseFloat(c.fade),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};1>=b.find(f).length||(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"}),b.find(":first-child").css(l),b.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)):(tabMarkup="",f.each(function(a){a+=1;tabMarkup+='
  • '+a+"
  • "}),e.append(tabMarkup),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); \ No newline at end of file