-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Carousel strange transition [bootstrap 3] #1350
Comments
@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 |
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> |
Hmm, seems like this is still a problem with the latest release of AngularJS: |
@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: 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. 😟 Thanks @simonykq... your workaround is nice. |
duplicate issue #1273 |
I refactored simonykq's solution, because I just wanted to disable ng-animate (never explicitly enable it) to get 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: |
@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. |
Thanks for the solution. but is there any update on this? will be fixed soon? |
Thanks for the workaround! This is such an annoying |
Hi, it doesn't work if I have a
If I remove |
Wrap it in an outer div. That has the ng-show on it.
|
Yeah.. this works. Thanks. |
I think the problem may come from the priority option in $compile service. ngShow use the default one which is 0. Try set the priority option in disable-ng-animate directive to something which is either greater or below 0 and see if this would fix the problem |
Thanks @simonykq for the workaround! This really needs to be fixed. |
Thank you @simonykq, that fixed the issue I was experiencing. BTW, I'm using:
|
Hi there, I'm using Angular 1.3.2, Bootstrap 3.x. On safari, the workaround doesn't fix the issue. The carousel is loaded, I can only click once on next/prev, then nothing else happen. Something strange, the next/prev slide is shown, but the first is still on the page. Here is my first slide, before I click next, on the left, 99 is the ID of this picture. And here is the second slide, after I click next, on the left, you can see the ID of this picture, but still the ID of the previous one. Here is the directive .directive('disableNgAnimate', ['$animate',
function ($animate) {
return {
restrict: 'A',
link: function (scope, element) {
$animate.enabled(false, element);
}
};
}]); Any idea ? Thanks a lot |
I think I'm suffering the same issue. In my case, when i press next or prev arrows sometimes I got the slide to change once, sometimes it doesn't event change. Same behavior in Chrome/Safari. It started to happen when I added ngAnimate to the project. |
Can we add a note about this ngAnimate + ui.bootstrap incompatibility to the FAQ? |
@bentleyo Know that feeling. Just went through the same tough process :( +1 for adding a line to the docs and mentioning the workaround (disabling ng-animate completely or only for the directive). |
I have a similar, but different problem. When slides scroll top part of pictures disappears. This happens only in (latest) Firefox. http://kulturfokus.eu/en/projekte/aufsteinernenspuren |
Fixes angular-ui#1350 Fixes angular-ui#1513 Fixes angular-ui#1185 Fixes angular-ui#2062 Fixes angular-ui#2235 Closes angular-ui#2067
Fixes angular-ui#1350 Fixes angular-ui#1513 Fixes angular-ui#1185 Fixes angular-ui#2062 Fixes angular-ui#2235 Closes angular-ui#2067
@simonykq thanks! |
@simonykq thanks!!! I lost almost a day trying to resolve this! |
This can also be remedied by specifying a specific prefix when configuring your app. angular.module('fooMod',['ngAnimate']).config(function($animateProvider) {
$animateProvider.classNameFilter(/prefix-/);
... We had an issue with the carousel after adding another library that required ngAnimate. This library uses CSS classes that begin with $animateProvider.classNameFilter(/anim-/); This tells ngAnimate to only animate classes that begin with See https://docs.angularjs.org/api/ngAnimate 'Preventing Collisions With Third Party Libraries' for more details. |
The work around doesn't seem to work when you are displaying carousel in $modal. $animateProvider.classNameFilter(/(app-repeated-item)|(modal)/); When I remove the class name filter, arrws on carousel seems to work fine. @simonykq solutions doesn't seem to work in this scenario. It seems absurd that ui-bootstrap which is pure angular implementation of bootstrap components, doesn't work with core angular modules. I fall-backed using native bootstrap components that works out of the box. |
@simonykq Thanks man, save my day :) |
Hi, I've used the disableNgAnimate but in my case the carousel directive is only toggling the 'active' class, not adding/removing the others used for animation, this means the slides only toggle but do not animate. I'm using "angular": "^1.3.0" with "angular-bootstrap": "~0.13.0". Any ideas how to fix this? EDIT: Nevermind, I found that I was using 1.4 and it's still not supported by angular-ui. Rolled back to 1.3.16 and everything is working again. |
@simonykq |
Thanks a lot man... great job. it works. |
I've made video that show behaviour (
angular 1.2.3
).https://dl.dropboxusercontent.com/u/21598387/AngularUI_Bootstrap3_carousel.mov
The text was updated successfully, but these errors were encountered: