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

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #34829

    Hello. Trying to implement AnythingSlider with a 100% width and height that will adjust to maintain the correct image ratio (ie not stretch the image). I was able to setup the slider with 100% width without a problem, but I’m having trouble getting the height to adjust.

    Currently I have the parent container set to a fixed height, but when it is removed or set to 100% the slider collapses. Any thoughts on how to fix?

    Demo can be found on:

    If I should post specific code snippets just let me know. Thanks in advance.


    Try this:

    $('#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.


    Awesome, that works perfectly. Thanks for the help Mottie!


    an example to 100% width, hope this help to any one


    tq ill try

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.