bxslider-3
bxslider-3 copied to clipboard
fluid height of .bx-window
Hi, I'm wondering if it's possible for the div with the class of bx-window to have fluid height, so that it resizes to the size of each slide, rather than take on the size of the largest slide for everything. Thanks!
You could write something that gets the height of the image/div onAfterSlide and resizes the height to that.
This worked for me:
Each div in the slider has an id like slider_0, slider_1, etc.
onAfterSlide: function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject){ $(".bx-window").animate({ height:$("#slider_" + currentSlideNumber).height() },950); }
You can actually use currentSlideHtmlObject
instead. That way you don't have to attach ID's to your slide elements.
onAfterSlide: function(currentSlideNumber, totalSlideQty, currentSlideHtmlObject){
$(".bx-window").animate({
height: currentSlideHtmlObject.height()
}, 250);
}
In the current version of bxslider there is an option called 'adaptiveHeight' that does exactly what you want if set to true (see http://bxslider.com/options#adaptiveHeight).
i throw now some content inther 2 facebookpost widgets and it doesn´t calculate the height for the content.