Ion-slide-box with different slide heights
Solution 1
You can use this :
.slider-slides{
display: flex;
flex-direction: row;
}
Solution 2
If you want a fixed height slider with every slides filling the slider height without leaving any blank space, In style.css add these lines:
.slider {
height: 200px; /* slider height you want */
}
.slider-slide {
color: #000;
background-color: #fff;
height: 100%;
}
Solution 3
$ionicScrollDelegate.resize(); did the trick
check this for codepen
Solution 4
strong text if you are using ionic 2 than add a scss.
.slide-zoom {
height: 100%;
}
and import this class in
<ion-content class=slide-zoom>
<ion-slides>
<ion-slide>
..............
</ion-slide>
<ion-slide>
..............
</ion-slide>
</ion-slides>
</ion-content>
Solution 5
You can use flex-box to organize the slides height:
.slider-slides {
display: flex;
}
Don't forget to reset slides height and all slides will get the biggest height :)
.slider-slide {
height: auto;
}
Related videos on Youtube
![sameera207](https://i.stack.imgur.com/Rb5G2.jpg?s=256&g=1)
Comments
-
sameera207 almost 2 years
I'm using
ion-slide-box
, but the issue is, myion-slide
s are not in the same height, So it sets all theion-slide
s to the size of heights one. Following is an example- ion-slide 1 height 30px
- ion-slide 2 height 100px
So,
ion-slide-box
height will be 100px, which make a blank space (70px) in the slide1. And when the user slide by using that blank space (70px),slider
doesn't work.What could be the way/workaround to have the
slidebox
work for different slide heights? -
Nikolay Fominyh about 9 yearsIt will lead to vertical line at left side of slider.
-
7200rpm over 8 yearsThis doesn't actually work since it calculates the size of the slide-box, (which is the longest slide) and not the slide itself.
-
gamengineers about 7 yearsThis with a combination of ion-slide { overflow-y: auto } worked for me. Thanks much!