angular-carousel icon indicating copy to clipboard operation
angular-carousel copied to clipboard

Carousel of images with different sizes

Open Purus opened this issue 9 years ago • 3 comments

I am trying to use the carousel of images with different image sizes. With such images, the carousel does not look good.

I am not sure how this can be achieved.

Below is the fiddle I created for a basic demo.

http://jsfiddle.net/Purus/tsvpu9cs/

Purus avatar Jan 31 '15 18:01 Purus

I also need help with different size images

bguyb avatar Feb 03 '15 09:02 bguyb

If you don't mind to fix the size of the carousel you can use: .bgimage { text-align:right; color:white; background-size:auto; background-repeat:no-repeat; height: 100%; background-position: center center; } Its good enough for me.

bguyb avatar Feb 03 '15 10:02 bguyb

O used:

<ul rn-carousel>
    <li ng-repeat="image in ad.images track by $index" rn-carousel-index="ad.carouselIndex">
        <div class="image-aspect-ratio">
            <img ng-src="{{image}}">
        </div>
    </li>
</ul>

css:

ul[rn-carousel] > li {
    position: relative;
    margin-left: -100%;
}
ul[rn-carousel] > li > .image-aspect-ratio {
    display: block;
    width: 100%;
    position: relative;
    height: 0;
    padding: 75% 0 0 0;
    overflow: hidden;
}

ul[rn-carousel] > li > .image-aspect-ratio img {
    position: absolute;
    display: block;
    max-width: 100%;
    max-height: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}
ul[rn-carousel] > li:first-child {
    margin-left: 0;
}

desenvolvedorindie avatar May 29 '15 11:05 desenvolvedorindie