我正在尝试淡出 Flash 嵌入对象并淡入常规 Html。
由于某种原因,在淡出完成之前,淡出方法的回调被多次触发。结果是 Html 在回调函数中被附加了多次,并且闪烁了额外的时间。
当我尝试淡化常规 Html 时,不会发生这种情况。
淡出功能是否不适用于闪光灯?
html:
<a id="HideFlash" href="#">Hide Flash</a>
<div id="FlashContainer" >
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
width="100" height="50" id="TEST" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="demo_banner.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="transparent">
<embed src="demo_banner.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100" height="50" name="TEST"
align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>
<div id="RegularContent" >
<h1>Before Fade</h1>
</div>
查询:
$('#HideFlash').click(function() {
$('#FlashContainer *').fadeOut('slow', function() {
$('#FlashContainer').append("<p style='display: none;'>This is in the flash container</p>");
$('#FlashContainer p').fadeIn('slow');
});
$('#RegularContent *').fadeOut('slow', function() {
$('#RegularContent').append("<p style='display: none;'>This is in the regular content after fade</p>");
$('#RegularContent p').fadeIn('slow');
});
});