그래서 현재 버튼을 눌러 행을 "비활성화"할 수있는 테이블이 있습니다. 행을 비활성화하면 불투명도가 변경되고 행이 회색으로 표시되어 행이 "비활성화 됨"임을 나타냅니다. '비활성화'버튼도 '활성화'로 변경됩니다. 내가 원하는 것은 "Activate"버튼을 눌러 행을 회색으로 할 수 있고 버튼은 다시 "Deactivate"로 바뀔 수 있습니다.두 번 버튼을 클릭 할 때 여러 기능
<tr>
<td class="mr_id" contenteditable="false"><?php echo intval ($rows['MR_ID'])?></td>
<td class="mr_name" contenteditable="false"><?php echo $rows['MR_Name']?></td>
<td class="buyer_id" contenteditable="false"><?php echo $rows['Buyer_ID']?></td>
<td class="poc_n" contenteditable="false"><?php echo $rows['MR_POC_N']?></td>
<td class="poc_e" contenteditable="false"><?php echo $rows['MR_POC_E']?></td>
<td class="poc_p" contenteditable="false"><?php echo $rows['MR_POC_P']?></td>
<td><button class="edit" name="edit">Edit</button>
<button class="deactivate" name="deactivate">Deactivate</button></td>
</tr>
자바 스크립트 :
// ----- Deactivate Row -----
$(document).ready(function() {
$('.deactivate').click(function() {
var $this = $(this);
if ($this.html() === 'Deactivate') {
$this.html('Activate');
var result = confirm("Are you sure you want to deactivate this entry?");
if(result) {
$this.closest('tr').css('opacity', 0.5);
}
}
});
});
나는 놀랍습니다. .... 당신이 한 것과 정반대로 행동하십시오. 속성 값과 같은 플립을 사용하여 취할 조치를 확인하십시오 –