gpt4 book ai didi

angularjs - 切换按钮不适用于 AngularJS 和 Angular ui Bootstrap

转载 作者:行者123 更新时间:2023-12-04 17:35:17 26 4
gpt4 key购买 nike

切换按钮出现,但它不工作。我现在在网上也有相同的代码,它不工作,但在 Plunker 它工作。

Plunker - toggle button is working

Same code online - button is not working

代码是:

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<div class="nalogo-wrapper">
<img class="img-responsive" src="http://placehold.it/50x50&text=Logo" />
</div>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#/view1"><span class="glyphicon glyphicon-home"></span> Etusivu</a></li>
<li><a href="#/view2">Palvelut</a></li>
<li><a href="#/view3">Yhteistiedot</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div id="main">
<div ng-view>
</div>
</div>

感谢帮助!
萨米人

最佳答案

我刚刚从一个使用 angular-ui bootstrap 的工作项目中复制了这个:

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle btn navbar-btn" ng-init="navCollapsed = true"
ng-click="navCollapsed = !navCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/#">Bake-Off</a>
</div>
<div collapse="navCollapsed" class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li><a href="#" >Link 1</a></li>
<li><a href="#" >Link 2</a></li>
<li></li>
</ul>
<div class="container navbar-form navbar-right">

</div>
</div>
<!--/.navbar-collapse -->
</div>
</div>

关于angularjs - 切换按钮不适用于 AngularJS 和 Angular ui Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21540903/

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