I am trying to create a fade transition carousel for my website created with Bootstrap and AngularJS. I have created the effect but I keep getting this flash to white between each slide instead of a nice fade over the previous image. You can see an example of it here now (until the question is answered or I fix it up):
http://development.artlyticalmedia.com/portfolio
I am using UI Bootstrap because it makes Bootstrap play nice with AngularJS, which already makes most of the solutions out there inaccurate because my html looks like this:
<div class="container-fluid text-center" ng-controller="PortfolioCtrl" id="portfolio">
<carousel interval="interval" class="carousel-fade">
<slide ng-repeat="slide in slides" active="slide.active">
<img ng-src="{{slide.image}}" alt="{{slide.alt}}">
</slide>
</carousel>
</div>
Notice that the <carousel>
element is not present in a standard Bootstrap carousel; I believe it is a <div class="carousel">
. My SCSS, which ought to give the correct effect, looks like this:
.carousel-fade {
.carousel-inner {
.item {
transition-property: opacity;
transition-duration: 1s;
opacity: 0;
}
.active {
opacity: 1;
}
.active.left,
.active.right {
left: 0;
opacity: 0;
z-index: 1;
}
.next.left,
.prev.right {
opacity: 1;
}
}
.carousel-control {
z-index: 2;
}
}
My Javascript is pretty standard, except that I disable $animate
because this was a fix I had to implement before. Here it is anyways:
angular.module('comartlyticalmediawwwApp')
.controller('PortfolioCtrl', function ($scope, $animate) {
$scope.interval = 3000;
$animate.enabled(false);
$scope.animate = null;
$scope.animateGlobal = true;
$scope.slides = [
{
image: 'images/portfolio/websites/3dsailing-Home.png',
alt: 'plan'
},
{
image: 'images/portfolio/websites/3dsailing-SailCoachPro.png',
alt: 'act'
},
{
image: 'images/portfolio/websites/3dsailing-3D-Printing.png',
alt: 'done'
},
{
image: 'images/portfolio/websites/Glass-Planner-Home.png',
alt: 'done'
},
{
image: 'images/portfolio/websites/Glass-Planner-PlanActDone.png',
alt: 'done'
},
{
image: 'images/portfolio/websites/Glass-Planner-Tutorials.png',
alt: 'done'
}];
});