當我將鼠標移過.test我希望.hide顯示,以及何時將鼠標移出。測試我希望.hide隱藏我的jquery函數執行了很多時間而不是一個
它不幸顯示它隱藏不止一次。
我的代碼是:
.hide{
opacity: 0;
filter: "old-ie-staff";
}
$(document).on('mouseover', '.test', function() {
$(this).find('.hide').animate({opacity: 1},300);
}).on('mouseout', function() {
$(this).find('.hide').animate({opacity: 0},300);
});
這裏小提琴鏈接:http://jsfiddle.net/malamine_kebe/2bnZW/
你應該看看在'.animate()'調用之前添加['.stop(true)'](http://api.jquery.com/stop/)。 – andyb 2013-04-26 08:48:36
非常感謝andyb – 2013-04-26 08:53:46