我正在开发一个应用程序,在该应用程序中点击一个按钮,然后 隐藏或显示特定元素。淡出和淡入转换无法在ng-hide上工作
我用AngularJS的ng-hide实现了这一点。出于某种原因,转换无法正常工作。我很新与CSS3转换,所以我做错了什么?
所有我希望它做的是淡出效果平稳淡出所以外观显得不那么不自然
CSS3
#custom-url{
-webkit-transition: all 2s ease;
transition: all 2s ease;
}
#custom-url .ng-hide{
opacity: 0;
}
HTML
<input ng-model="custom_url" id="custom-url" ng-show="customMode" type="text" placeholder="Place your custom URL text here" class="ng-hide form-control"/>
<button class="btn btn-success" ng-click="customMode = !customMode">Make my own URL <b class="glyphicon glyphicon-heart"></b></button></div>
AngularJS
(function(angular) {
angular.module('urlShortener', [])
.controller('shortenerController', function($scope){
$scope.customMode = false;
})
})(window.angular);
谁能帮助?
大证据充分的回答。谢谢 –
@OliverK不客气! – PSL