我正在使用swfobject将flash对象动态加载到div中,我想知道是否有一种简单的方法来显示加载动画,直到flash对象准备好显示?在这种情况下,我正在加载一个嵌入的Issuu对象,你可以通过swfobject here看到一个Issuu加载的例子。根据您的连接速度,Flash对象加载时通常只有一个空白空格,如果可能的话,指示加载动画的进度会很棒。我想这里的jQuery可以服务......
感谢您的任何指示。
答案 0 :(得分:1)
在您的嵌入代码中,您不仅要传递要由swf(idOfTagToReplace
)替换的标记的ID,还要传递替换它的标记的id(issuuViewer
)。
在您调用swfobject之后,根据需要设置后一个标记的样式。
var attributes = {
id: 'issuuViewer'
};
var params = {
allowfullscreen: 'true',
menu: 'false',
wmode: 'transparent'
};
var flashvars = {
jsAPIClientDomain: 'www.yourdomain.dk',
mode: 'mini',
documentId: '081219132433-764a1eafce5141fda136d10d58bd45f5'
};
swfobject.embedSWF(
"http://static.issuu.com/webembed/viewers/style1/v2/IssuuReader.swf",
"idOfTagToReplace",
"420",
"264",
"9.0.0",
"swfobject/expressInstall.swf",
flashvars,
params,
attributes
);
var obj = document.getElementById('issuuViewer');
obj.style.backgroundImage = 'url(/img/loading.gif)';
obj.style.backgroundRepeat = 'no-repeat';
obj.style.backgroundPosition = '50% 50%';