2
是否有可能將hover()綁定到帶有指定選擇器的文檔,以便爲具有匹配屬性的動態添加內容分配JS函數?jQuery綁定懸停到「文檔」
我一直在尋找這兩個主題:JQuery .on() method with multiple event handlers to one selector和Is it possible to use jQuery .on and hover?
,目前我使用:
$('.profile-gallery-image-container').on({
mouseenter: function(){
$('.delete-image', this).show();
$('.image-options', this).show();
},
mouseleave: function(){
$('.delete-image', this).hide();
$('.image-options', this).hide();
}
}, '.profile-gallery-image-container');
但沒有能夠與選擇匹配傳遞功能,新內容。
好的,謝謝。學到了新東西。與文件一起工作。 – user1683645
@ user1683645不客氣! – VisioN