Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS AnythingSlider and 100% Width/Height Problem Re: AnythingSlider and 100% Width/Height Problem

#89316
Mottie
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.