码迷,mamicode.com
首页 > Web开发 > 详细

angularJs tab样式切换方法之一

时间:2017-04-14 16:10:57      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:cli   span   active   切换   font   方法   nbsp   htm   lis   

html:

<ul class="nav-list">
<li ng-class="{‘active‘ : current == 5}" ng-click="setCurrent(5)"><a ui-sref=".goodsManage" >商品管理</a></li>
<li ng-class="{‘active‘ : current == 6}" ng-click="setCurrent(6)"><a href="" >仓库签约</a></li>
<li ng-class="{‘active‘ : current == 7}" ng-click="setCurrent(7)"><a href="" >客户管理</a></li>
</ul>


js
//点击,样式变换
$scope.setCurrent = function(index){
$scope.current = index;
}



注: 其中 active 为点击后要添加上的样式

 

angularJs tab样式切换方法之一

标签:cli   span   active   切换   font   方法   nbsp   htm   lis   

原文地址:http://www.cnblogs.com/maochunyan/p/6709345.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!