diff --git a/responsiveslides.js b/responsiveslides.js index c4b1ec8..37d2690 100644 --- a/responsiveslides.js +++ b/responsiveslides.js @@ -1,4 +1,4 @@ -/*! ResponsiveSlides.js v1.05. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ +/*! ResponsiveSlides.js v1.06. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ (function ($, window, i) { $.fn.responsiveSlides = function (options) { // Settings @@ -15,6 +15,8 @@ var slideshow = function () { var $slide = $this.find('img'), + hasTouch = 'ontouchstart' in window, + startEvent = hasTouch ? 'touchstart' : 'mousedown', namespace = 'rslides', namespace_i = namespace + i, namespace_i_class = namespace + ' ' + namespace_i, @@ -78,9 +80,14 @@ $('.' + slide_class_prefix + '1').parent().addClass(active_class); $('.' + tabs_class + ' a').each(function (i) { + var $el = $(this); - $el.click(function (e) { + + $el.bind('click', function (e) { e.preventDefault(); + }); + + $el.bind(startEvent, function () { // Prevent clicking if animated if ($('.' + visible_class + ':animated').length) { diff --git a/responsiveslides.min.js b/responsiveslides.min.js index 73729bb..382da5c 100644 --- a/responsiveslides.min.js +++ b/responsiveslides.min.js @@ -1,5 +1,5 @@ -/*! ResponsiveSlides.js v1.05. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ -(function(a,o,n){a.fn.responsiveSlides=function(e){var f=a.extend({speed:4E3,fade:1E3,auto:!0,maxwidth:"none"},e);return this.each(function(){n++;var b=a(this),g=function(){var a=parseFloat(f.maxwidth);e&&e.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()'),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};if(1'+a+""});c.append(m);b.after(c).find(":first-child").addClass(h);a("."+i+"1").parent().addClass("rslides_here");a("."+k+" a").each(function(b){var c=a(this);c.click(function(d){d.preventDefault();if(a("."+h+":animated").length)return!1;c.parent().hasClass("rslides_here")||(a("."+k+" li").removeClass("rslides_here"),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("rslides_here"))})})}})();g();a(o).resize(function(){g()})})}})(jQuery,this,0); \ No newline at end of file +/*! ResponsiveSlides.js v1.06. (c) 2011-2012 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ +(function(a,n,o){a.fn.responsiveSlides=function(e){var f=a.extend({speed:4E3,fade:1E3,auto:!0,maxwidth:"none"},e);return this.each(function(){o++;var b=a(this),h=function(){var a=parseFloat(f.maxwidth);e&&e.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()'),l={position:"relative","float":"left"},p={position:"absolute","float":"none"};if(1'+a+""});c.append(m);b.after(c).find(":first-child").addClass(g);a("."+i+"1").parent().addClass("rslides_here");a("."+k+" a").each(function(b){var c=a(this);c.bind("click",function(a){a.preventDefault()});c.bind(e,function(){if(a("."+g+":animated").length)return!1;c.parent().hasClass("rslides_here")||(a("."+ +k+" li").removeClass("rslides_here"),a("."+g).stop().fadeOut(j,function(){a(this).removeClass(g).css(p)}).end(),a("#"+i+b).stop().fadeIn(j,function(){a(this).addClass(g).css(l)}).end(),c.parent().addClass("rslides_here"))})})}})();h();a(n).resize(function(){h()})})}})(jQuery,this,0); \ No newline at end of file