Click here to view the demo.的jQuery的mouseenter工作不針對特定的div
下面是代碼
jQuery(document).ready(function($) {
$(".works").mouseenter(function(e) {
$(".img_details").stop().animate({ 'bottom':'5%', 'opacity':'1'},500);
e.preventDefault();
});
$(".works").mouseleave(function(e) {
$(".img_details").stop().animate({ 'bottom':'100%', 'opacity':'0'},500);
e.preventDefault();
});
})(jQuery);
有兩個div與類名「作品」,它認爲具有類名「img_details」一個DIV 。如果鼠標指針進入第一個div「img_details」也加載到兩個div。我想加載一次特定的div。我錯過了什麼?
在這兩種處理程序使用'$( 「img_details。」,這一點).sto ...' – Tushar