Carousel strange transition [bootstrap 3]
I've made video that show behaviour (angular 1.2.3).
https://dl.dropboxusercontent.com/u/21598387/AngularUI_Bootstrap3_carousel.mov
@djordje what is the version of this library that you are using? Please note that BS3 support is only available in the development branch (bootstrap3).
Latest bootstrap3 branch - d7c69d462f
Yep. I can confirm this behaviour. It happens only when ngAnimate module is loaded. Tested with angular 1.2.3 & bootstrap3 d7c69d4.
I can confirm that its about ngAnimate. (bs3, angular 1.2.0)
I found work around: http://plnkr.co/edit/8HfZCaTOIeAesKVFSFpj?p=preview
@djordje ty very much it realy saves so much of my time.
First to create a directive as following :
app.directive('disableAnimation', function($animate){
return {
restrict: 'A',
link: function($scope, $element, $attrs){
$attrs.$observe('disableAnimation', function(value){
$animate.enabled(!value, $element);
});
}
}
});
Given that your app have already declared 'ngAnimate' as dependency. Then, create the following HTML code, and it should work
<carousel interval="5000" disable-animation="true">
<slide ng-repeat="slide in slides">
<img ng-src="{{slide.image}}" width="1000" height="300" style="margin:auto;">
</slide>
</carousel>
@djordje
Hmm, seems like this is still a problem with the latest release of AngularJS: http://plnkr.co/edit/Xl5Ok6UOJFAuZyTxO39F?p=preview
@djordje - great workaround, thanks a lot.
Workaround works, thanks.
But could you please fix this? It still exists in AngularJS 1.2.14.
I've modified your example code: http://plnkr.co/edit/PKiOP8D4vPnVy8wNOidO
Thank you!
@Aldentev That is going to be fixed on the next version.
This still happens in 1.2.16
Yep... still happening in 1.2.16. :worried:
Thanks @simonykq... your workaround is nice.
duplicate issue #1273
@simonykq :+1:
I refactored simonykq's solution, because I just wanted to disable ng-animate (never explicitly enable it) to get <carousel> to work. I also made the code minification safe and "optimized" the link function by dropping the unused $attrs parameter.
CoffeeScript:
app.directive 'disableNgAnimate', ['$animate', ($animate)->
restrict: 'A'
link: (scope, element)-> $animate.enabled false, element
]
JavaScript:
app.directive('disableNgAnimate', ['$animate', function($animate) {
return {
restrict: 'A',
link: function(scope, element) {
$animate.enabled(false, element);
}
};
}]);
Use:
<carousel disable-ng-animate>
...
</carousel>
I'm currently using Angular-Bootstrap v0.11.0 and Angular.js v1.2.19. I've tried disabling ngAnimate entirely and the workaround Directive that selectively disables ngAnimate, but I can't get the carousel to work. The slide classes don't update when they try to transition, so slide 1 has the following classes: item text-center ng-isolate-scope active left and slide 2 has item text-center ng-isolate-scope next left and it remains stuck there. Nothing changes. The prev() and next() buttons also do nothing.
@simonykq thank you!
@whitehat101. Yes yours is better. Many thanks
@simonykq @whitehat101 Thanks for the solution.
@simonykq @whitehat101 Thanks your solution works simple and neat. I am a newbie and I don't understand what this is really doing inside the carousel and outside it. Could you give me a quick explanation? If this is not really the place to ask then please forgive me and ignore.