我在页面中有下拉切换。我正在使用AngularJS。我想在页面加载时自动打开它。这是我的代码:
<div class="item dropdown customdrop" >
<a href="#" class="dropdown-toggle" >
<img src="img/bell.png"> <span class="toggle-username">Alerts <i class="fa fa-caret-down"></i></span>
</a>
<ul class="dropdown-menu dropdown-menu-left" >
<li class="dropdown-header">Notifications</li>
<li class="divider"></li>
<li>
<div> <span class="text-left ndata"> Notifications </span> <span class="text-right"> 5</span></div><br>
<div> <span class="text-left ndata"> Notifications </span> <span class="text-right"> 5</span></div><br>
<div> <span class="text-left ndata"> Notifications </span> <span class="text-right"> 5</span></div><br>
<div> <span class="text-left ndata"> Notifications </span> <span class="text-right"> 5</span></div><br>
<div> <span class="text-left ndata"> Notifications </span> <span class="text-right"> 5</span></div><br>
</li>
</ul>
</div>
答案 0 :(得分:0)
您需要在下拉列表中添加is-open
选项:
<div class="item dropdown customdrop" is-open="status.isopen">
您的控制器应将其设置为默认打开:
.controller('MyCtrl', function ($scope) {
$scope.status = {
isopen: true
};
});