感谢您的答复-
我最终做到了,它有效;)
-指令-
.directive('fadeIn', function($timeout){ return { restrict: 'A', link: function($scope, $element, attrs){ $element.addClass("ng-hide-remove"); $element.on('load', function() { $element.addClass("ng-hide-add"); }); } };})
-模板-
<img ng-src="{{program.image}}" fade-in />
-CSS-
.animate-show.ng-hide-add, .animate-show.ng-hide-remove { transition: all linear 0.5s; display: block !important;}.animate-show.ng-hide-add.ng-hide-add-active, .animate-show.ng-hide-remove { opacity: 0;}.animate-show.ng-hide-add, .animate-show.ng-hide-remove.ng-hide-remove-active { opacity: 1;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)