ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

autoHeight available? #31

Open alereisan opened 8 years ago

alereisan commented 8 years ago

Is it possible to get autoHeight="true" to work (from swiper api: http://idangero.us/swiper/api/#.VuVpepwrLIV)?

Set to true and slider wrapper will adopt its height to the height of the currently active slide

brh55 commented 8 years ago

Using the override-parameters attribute, you can extend any additional properties to the swiper instance.

Use

ks-override-parameters="{'autoHeight':'true'}"

Example Markup

<ks-swiper-container initial-slide="3" loop="false" show-nav-buttons="false" slides-per-view="4" space-between="5" pagination-clickable="false" ks-override-parameters="{'autoHeight':'true'}">
    <ks-swiper-slide class="swiper-slide" ng-repeat="s in [1,2,3,4,5,6,7,8,9,10,11,12,13,14]">
        <img ng-src="http://api.randomuser.me/portraits/thumb/men/{{s}}.jpg">
    </ks-swiper-slide>
</ks-swiper-container>