2
我有一些小divs,當點擊時,顯示一個更大的div覆蓋的一切 - 有點像一個燈箱。爲了隱藏大div,我點擊它(沒有「關閉此」鏈接)。中斷mouseenter原因循環點擊
這裏的點擊代碼:
// First click - draw in
$('.compositos_DBitem').on('click', function(){
// Some stuff going on here...
function(){
// Animate the lightbox elements
$('.compositos_DBitem_lightbox', this).fadeIn(500);
$('.compositos_lightboxBackground').fadeIn(500);
// Second click - draw back
$(this).on('click', function(){
$('.compositos_DBitem_lightbox', this).fadeOut(500);
$('.compositos_lightboxBackground').fadeOut(500);
});
});
});
的.compositos_lightboxBackground是背景疊加DIV和.compositos_DBitem_lightbox是大的div。
的問題是,點擊大格(當它顯示)後,它消失了,背 - 如果你不離開德大div的區。如果我點擊它並快速移出鼠標,它就會起作用。
怎麼了?
佩德羅
完美。謝謝@ XGundam05。 – Pedro