Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好,我有闪烁的问题。我创建了一个小提琴,所以你们可以帮助我。谢谢!!!
JSfiddle
JS代码:
$(document).ready(function(){ $("img").mouseover(function(){ $("img").css("display","none"); }); $("img").mouseout(function(){ $("img").css("display","block"); }); });
而不是display你可以尝试opacity。这不会删除 img 而是使其透明,因此它仍会接收鼠标事件:
display
opacity
$(document).ready(function(){ $("img").mouseover(function(){ $("img").css("opacity",0); }); $("img").mouseout(function(){ $("img").css("opacity",1); }); });