我用ng-repeat渲染出数据后,想修改某一个指定的DOM元素的样式,下面是示例代码 <ul ng-repeat="item in city" repeat-done="cityFinish()">
<li class="city city{{$index}}">{{item}}</li>
</ul> $scope.cityFinish = function() {
$('.city').css('background', 'red');
$('.city1').css('background', 'green');
};其中 $('.city').css('background', 'red');有效,但是$('.city1').css('background', 'green');无效,这是什么原因?
添加回答
举报
0/150
提交
取消