diff --git a/source/jquery.slides.coffee b/source/jquery.slides.coffee index cdeb9ba..6cde3d6 100755 --- a/source/jquery.slides.coffee +++ b/source/jquery.slides.coffee @@ -102,6 +102,11 @@ $.data this, "current", @options.start - 1 $.data this, "vendorPrefix", @_getVendorPrefix() + #Check if only one element is present + if @data.total == 1 + $element.show() + return false + # Detect touch device if typeof TouchEvent != "undefined" $.data this, "touch", true @@ -516,7 +521,7 @@ # Stop/pause slideshow on mouse enter slidesContainer.bind "mouseenter", => clearTimeout @data.restartDelay - $.data this, "restartDelay", null + $.data this, "restartDelay", null @stop() # Play slideshow on mouse leave diff --git a/source/jquery.slides.js b/source/jquery.slides.js index f5b2d27..3021d8a 100644 --- a/source/jquery.slides.js +++ b/source/jquery.slides.js @@ -1,6 +1,5 @@ -// Generated by CoffeeScript 1.6.1 +// Generated by CoffeeScript 1.6.3 (function() { - (function($, window, document) { var Plugin, defaults, pluginName; pluginName = "slidesjs"; @@ -41,7 +40,6 @@ } }; Plugin = (function() { - function Plugin(element, options) { this.element = element; this.options = $.extend(true, {}, defaults, options); @@ -62,6 +60,10 @@ $.data(this, "total", $element.children().not(".slidesjs-navigation", $element).length); $.data(this, "current", this.options.start - 1); $.data(this, "vendorPrefix", this._getVendorPrefix()); + if (this.data.total === 1) { + $element.show(); + return false; + } if (typeof TouchEvent !== "undefined") { $.data(this, "touch", true); this.options.effect.slide.speed = this.options.effect.slide.speed / 2; @@ -391,6 +393,8 @@ if (this.options.play.pauseOnHover) { slidesContainer.unbind(); slidesContainer.bind("mouseenter", function() { + clearTimeout(_this.data.restartDelay); + $.data(_this, "restartDelay", null); return _this.stop(); }); slidesContainer.bind("mouseleave", function() {