1
我有一個表與ng-repeat <tr>
在與最後td我有編輯/刪除鏈接,我只希望他們顯示,如果用戶懸停在<tr>
顯示編輯/刪除鏈接時懸停在數據列上
<tr ng-repeat="form in allData | filter:search | orderBy: orderByValue : orderIn" ng-click="set_index($index)">
<td><a ng-href={{form.link}}>{{form.ar_ref}}</a></td>
<td>{{form.title}}</td>
<td>{{form.category}}
<span ng-class="{'show_edit_link', $index==selected_index}">
<button ng-click="showUpdate()">Update</button>
<button ng-click="showDelete()">Delete</button>
</span>
</td>
</tr>
我的JS控制器:
pp.controller('formsListCtrl', ['$scope', '$http', function($scope, $http){
$http.get('/php_user/formJSON.php').success(function(response){
$scope.allData=response;
//Show hover edit links
$scope.selected_index = 0;
$scope.set_index = function(i){ //i is the $index that we will pass in when hover in the forms_admin.php
$scope.selected_index = i;
}
CSS:
.edit_link_show{
display: inline;
}
.edit_link{
display: none;
}
這有什麼錯絡CSS? http://codepen.io/anon/pen/ONzVLL –
oOo〜好,聰明。 –