我得到了這個網站:通過class和id的jQuery顯示DIV組合
<img src="pics/delete.png" class="showdelete" style="position: absolute; display: none" id="1"
<img src="pics/delete.png" class="showdelete" style="position: absolute; display: none" id="2"
<img src="pics/delete.png" class="showdelete" style="position: absolute; display: none" id="3"
而且這個jQuery至今:
function showdelete(z){
var show = $(z).attr('id');
}
讓說的變種是2.如何將代碼看起來完全以show class showdelete與id 2?
編輯
好吧,我從下面的解決方案,但試圖隱藏它再次鼠標離開
我tryed: HTML:
<div class="profilfotos" id="' . $row["id"] . '" onmouseover="showdelete(this)" mouseleave="hidedelete(this)">
和jQuery:
function hidedelete(z){
var show = $(z).attr('id');
$('img[class=showdelete][id='+show+']').hide();
}
該死的應該是OnMouseLeave在代替你爲什麼會想一個ID選擇帶班 – user2966167 2014-10-31 06:52:25