Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngb-carousel how can I have animation like fade-in/out between Images/Slides?

In Ng bootstrap carousel component how can I have transition like fade-in/out between Images/Slides ?

like image 568
Saeid Ostad Avatar asked Oct 17 '22 09:10

Saeid Ostad


1 Answers

I found a way to include a fade in/out like animation.

You have to define the .carousel-item and .carousel-item.active css class as follows:

.carousel-item {
    display: block !important;
    z-index: 1;
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, visibility 1s;
    visibility: hidden;
}
.carousel-item.active {
    position: relative;
    opacity: 1;        
    transition: opacity 1.5s ease-in-out, visibility 1s;
    visibility: visible;
    
}
like image 196
Jesús Noè Nogueiras Avatar answered Oct 21 '22 03:10

Jesús Noè Nogueiras