【发布时间】:2020-06-13 11:55:52
【问题描述】:
动画似乎不起作用。
<div ng-cloak class="customize-modal text-white" ng-show="isMenuOpened == true">
...
</div>
这是我的 CSS:
.customize-modal {
position: fixed;
left: 0;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.8);
max-width: 100vw;
max-height: 100vh;
overflow: scroll;
padding: 10px;
-webkit-transition: max-width 0.5s linear;
-moz-transition: max-width 0.5s linear;
-o-transition: max-width 0.5s linear;
transition: max-width 0.5s linear;
}
.customize-modal.ng-hide {
max-width: 0px;
}
我只是设置了$scope.isMenuOpened true 和 false 来显示和隐藏它。
【问题讨论】:
-
尝试使用 ng-if 代替 ng-show
-
同样的结果没有动画
-
尝试将 isMenuOpened 放入一个对象中,然后尝试例如$scope.info={isMenuOpened :false};...
标签: javascript html css angularjs