$('#div1, #div2').click(function(){
//Code to execute onclick
});
$('#div1, #div2').hover(function(){
$(this).animate({
'filter':'alpha(opacity=100)',
'-moz-opacity':'1',
'-khtml-opacity':'1',
'opacity': '1'},
250,
function(){
$(this).animate({
'filter':'alpha(opacity=75)',
'-moz-opacity':'0.75',
'-khtml-opacity':'0.75',
'opacity': '0.75'},
500)
});
});
我有兩個div,包含點擊事件和懸停事件,並且都有動畫。我怎樣才能讓這個當用戶將鼠標懸停在任格: -禁用點擊,直到懸停動畫完成
- the click event doesnt work until the hover animation is complete
- and then the hover animation doesnt work until the click animation is complete
目前,如果用戶點擊DIV1,然後徘徊在DIV2之前,點擊完成它的不良影響,例如閃爍事物消失