Home › Forums › CSS › AnythingSlider and 100% Width/Height Problem › Re: AnythingSlider and 100% Width/Height Problem
October 19, 2011 at 5:53 pm
#89316
Member
Try this:
$(window).resize(function(){
$('#wrapper1').height( $(window).width()/2.3 );
});
The images inside of AnythingSlider are 1161×500 in size, or they have an aspect ration of approximately 2.3 (1161 divided by 500).
So what that code does is applies that same aspect ratio to the container around AnythingSlider (#wrapper1). And since the “expand” option is true, the slider will expand to fit inside of that container and maintain the ratio you want.