diff --git a/.gitignore b/.gitignore index fffec08..4d03568 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.esproj .DS_Store .codekit-cache -node_modules \ No newline at end of file +node_modules +.idea/**/* diff --git a/src/js/unslider.js b/src/js/unslider.js index 5e9e7e7..d09018e 100755 --- a/src/js/unslider.js +++ b/src/js/unslider.js @@ -507,9 +507,7 @@ // If we want to change the height of the slider // to match the current slide, you can set // {animateHeight: true} - if(self.options.animateHeight) { - self._move(self.$context, {height: self.$slides.eq(to).outerHeight()}, false); - } + self.animateHeight(to); // For infinite sliding we add a dummy slide at the end and start // of each slider to give the appearance of being infinite @@ -560,7 +558,12 @@ // Fade between slides rather than, uh, sliding it - self.animateFade = function(to) { + self.animateFade = function(to) { + // If we want to change the height of the slider + // to match the current slide, you can set + // {animateHeight: true} + self.animateHeight(to); + var $active = self.$slides.eq(to).addClass(self.options.activeClass); // Toggle our classes @@ -568,6 +571,16 @@ self._move($active, {opacity: 1}, false); }; + // Animate height of slider + self.animateHeight = function(to) { + // If we want to change the height of the slider + // to match the current slide, you can set + // {animateHeight: true} + if (self.options.animateHeight) { + self._move(self.$context, {height: self.$slides.eq(to).outerHeight()}, false); + } + }; + self._move = function($el, obj, callback, speed) { if(callback !== false) { callback = function() {