0
我有一段代碼,用於顯示當鼠標進入div時從div滑出的圖片,代碼完全按照我的想法工作,除了它在鼠標懸停進出時發生錯誤過快和動畫沒有時間去完成,我已經從鼠標懸停及移出變化,到了mouseenter和鼠標離開,這似乎並沒有幫助,任何建議將是巨大鼠標進入鼠標離開slidedown動畫錯誤
<script type="text/javascript">
document.observe("dom:loaded", function() {
var effectInExecution=null;
$('mid_about_us').observe('mouseenter', function() {
if(effectInExecution) effectInExecution.cancel();
effectInExecution=new Effect.SlideDown('about_us_mo',{style:'height:140px;', duration: 1.0 });
});
$('mid_about_us').observe('mouseleave', function() {
if(effectInExecution) effectInExecution.cancel();
effectInExecution=new Effect.SlideUp('about_us_mo',{style:'height:0px;', duration: 1.0 });
});
});