gpt4 book ai didi

javascript - AngularJS ngHide ngShow 在 IE 中反转

转载 作者:行者123 更新时间:2023-11-28 08:50:35 24 4
gpt4 key购买 nike

我有一些 angularjs ngHidengShow 代码。它们在 Chrome 中工作正常,但在 IE 中表现相反。代码如下:

 <section ng-controller="ctrl">
<div class="details" ng-show="showDetails">
Section 1
</div>

<div class="move-details" ng-hide="showDetails">
Section 2
</div>
</section>

JS 文件:

var ctrl = ['$scope', 'model', function($scope, model) {
$scope.showDetails = true;
}];

在 IE 中显示带有 Section 2 的文本,而不是 Section 1,但 Section 1 在 Chrome 中显示,正如我所期望的那样。

我是不是错过了什么?

最佳答案

<section> 切换到 <div>标签解决了问题。

关于javascript - AngularJS ngHide ngShow 在 IE 中反转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19190051/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com