Last active
August 29, 2015 14:04
-
-
Save KnightAlex/9cfe0da49683fe577a27 to your computer and use it in GitHub Desktop.
Woothemes Flexslider - responsive height fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fixHeight() { | |
var maxHeight = 0, | |
slides = el.find('.slides'), | |
data = el.data('flexslider'); | |
slides.children() | |
.height('auto') | |
.each(function() { | |
maxHeight = Math.max(maxHeight, $(this).height()); | |
}) | |
.height(maxHeight); | |
slides.height(maxHeight); | |
data && (data.h = maxHeight); | |
} | |
win.load(fixHeight); | |
win.resize($.throttle ? $.throttle(250, fixHeight) : fixHeight); | |
fixHeight(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment