In Ionic, how to set autoHeight ion slides to true with ion scroll content?

I would like the slider to adapt its size to the active height of the slide.

There is an option autoHeight: true, but it does not work

options: { autoHeight:true } 

It only works if the ionic content scroll is set to false.

+5
source share
2 answers

I can make swiper in ionic to have auto size in height with this css

 .swiper-wrapper { position: relative; } 

and my parameters are only the default parameters specified in the documentation for the ionic version

 vm.options = { loop: true, effect: 'fade', speed: 500, }; 
0
source

This base, you can add the following css:

 .swiper-slide:not(.swiper-slide-active) > div { display:none; } 

I tested it and it works great.

0
source

Source: https://habr.com/ru/post/1246052/


All Articles