在更新 1.4.1 中,AngularJs Animate 不再像以前那样在页面加载时触发。我的旧解决方案类似对此 - 笨蛋 (found here并一直工作到 v1.3.9)。
<script>
angular.module('app', ['ngAnimate'])
.controller('contr', function ($scope, $rootElement) {
$rootElement.data("$$ngAnimateState").running = false;
});
</script>
<style>
h1.ng-enter {
opacity: 0;
-moz-transition: opacity 10s ease;
-o-transition: opacity 10s ease;
-webkit-transition: opacity 10s ease;
transition: opacity 10s ease;
}
h1.ng-enter-active {
opacity: 1;
}
</style>
</head>
<body ng-app="app" ng-controller="contr">
<h1 ng-if="true">Big headline</h1>
</body>
但这不再起作用了。所以我正在做这——笨蛋
<script>
angular
.module('app', ['ngAnimate'])
.controller('contr', function ($scope, $interval) {
$scope.bool1 = false;
$interval(function () {
$scope.bool1 = true;
}, 1, 1);
});
</script>
<!--same css and html-->
这对我来说感觉有点像黑客行为。在 1.4.1+ 版本中是否有更好的方法在页面加载时产生动画?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)