You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slider height collapses by removing height from container class #647
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...
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.
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.
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:
The outer container does not automatically adjust it's height based on the width; you're stuck with a fixed height.
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.
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. :)
Activity
Mottie commentedon Apr 29, 2016
Hi @DeathAngelDaemon!
You can set the
expandoption totrue, and then set anaspectRatiovalue to calculate the width and height.Check out the demos on, and look at the source code of, the expand demo page.
annaf-dev commentedon May 2, 2016
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.
Mottie commentedon May 2, 2016
It looks like the problem is due to the outer container size. If you add the following css to the demo:
everything "appears" to start working; but there are two big problems:
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.
annaf-dev commentedon May 10, 2016
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. :)