Skip to content

Slider height collapses by removing height from container class #647

Open

Description

@annaf-dev

Hi,

I want to have a flexible (responsive) Slider. It works so far, but only if I set the height of the slider container. But then I have space at the bottom of the slider (if I resize the window).
By removing the fix height from the slider container the slider itself collapses and begins to flicker...

You can try here: http://codepen.io/DeathAngelDaemon/pen/dMgzoe

Does anyone have an idea what to do? I tried a lot of things I've found in the internet, but nothing works for me. :( So hopefully there is another solution.

Activity

  1. Mottie commented on Apr 29, 2016

    @Mottie
    Contributor

    Hi @DeathAngelDaemon!

    You can set the expand option to true, and then set an aspectRatio value to calculate the width and height.

    Check out the demos on, and look at the source code of, the expand demo page.

  2. annaf-dev commented on May 2, 2016

    @annaf-dev
    Author

    Hi Mottie,
    thanks for the hint, but I also tried that.
    I updated the pen above (commented out the height for .slider-container class and added the aspectRatio attribute) - now it flickers and the images collapse to a very small size.

  3. Mottie commented on May 2, 2016

    @Mottie
    Contributor

    It looks like the problem is due to the outer container size. If you add the following css to the demo:

    .slider-container {
       width: 100%;
       height: 374px;
    }

    everything "appears" to start working; but there are two big problems:

    1. The outer container does not automatically adjust it's height based on the width; you're stuck with a fixed height.
    2. Shrinking the window does resize the content using the aspect ratio, but re-expanding the window leaves the content stuck at its smallest size 😞.

    To be honest, the main code for this plugin hasn't been touched in about 2 1/2 years. And looking at the code now, it looks like a huge mess! Sadly, I don't have the time, nor the inclination to rewrite it.

    The good news is that there are much better responsive sliders available now, especially if you only want to show images. Please consider switching. Maybe someday I'll have time to rewrite this plugin.

  4. annaf-dev commented on May 10, 2016

    @annaf-dev
    Author

    I see you understand my problem.
    Thanks for your honest answer. I already tried other slider plugins, but none of them seems to fit my claims.
    I will look around for more alternatives. Thanks for your time. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions