1
我正在努力解決一個我無法處理的問題,我有一個來自我的數據庫的記錄表,它通過while循環創建,所以它們看起來都一樣。問題是用一個簡單的.delete點擊然後.warning淡入淡出函數將出現所有具有相同類的div,但我需要一個代碼,只有一個div會出現。希望你明白。jQuery parent next似乎沒有工作
HTML代碼:
<td>
<img class='delete' title='Delete Row' alt=\"Delete\" src='css/images/delete.png'/>
<div class='warning'>Are you sure you want to delete this record ?<br/>
<a id='yes' href=\"delete_client.php?column1=".$row['client_id']."\">Yes</a>
<a id='no'>No</a>
</div>
</td>
<br/>
<td>
<img class='delete' title='Delete Row' alt=\"Delete\" src='css/images/delete.png'/>
<div class='warning'>Are you sure you want to delete this record ?<br/>
<a id='yes' href=\"delete_client.php?column1=".$row['client_id']."\">Yes</a>
<a id='no'>No</a>
</div>
</td>
<br/>
<td>
<img class='delete' title='Delete Row' alt=\"Delete\" src='css/images/delete.png'/>
<div class='warning'>Are you sure you want to delete this record ?<br/>
<a id='yes' href=\"delete_client.php?column1=".$row['client_id']."\">Yes</a>
<a id='no'>No</a>
</div>
</td>
我想這jQuery代碼,但它似乎沒有工作,因爲沒有出現。
$('.delete').click(function() {
$(this).parent().next('.warning').fadeIn('slow');
});
非常感謝穆罕默德! – ewing1990 2013-04-21 12:17:08