模版网站建设、SEO交流QQ236073415

js实现加载flash显示进度条代码分享

网站建设 lch274 1357℃ 0评论

自己写的一段代码,加载flash显示进度条,已经测试过,把flash地址换成你的就可以了

<style type=”text/css”>
body{
text-align:center;
}
.graph{
position:absolute;
margin-top:100px; margin-left:280px;
width:450px;
border:1px solid #C8C8C8;
height:25px;
}
#bar{
display:block;
background:#ACD429;
float:left;
height:100%;
text-align:center;
color:#FFFFFF;
}
#barNum{
position:absolute;
}
</style>

<div id=”d1″>
<embed type=”application/x-shockwave-flash” pluginspage=”http://www.adobe.com/go/getflashplayer” id=”mgame” name=”mgame” width=”640px” height=”480px” src=2.swf” allowscriptaccess=”always” allownetworking=”all” wmode=”window” quality=”high”>
</div>
<div class=”graph”>
<strong id=”bar” style=”width:1%;”></strong>
</div>

<script language=”javascript”>

function $(obj){
return document.getElementById(obj);
}

function ck()
{
var mFlash=document.getElementById(“mgame”);

$(“bar”).style.width = mgame.PercentLoaded()+”%”;
$(“bar”).innerHTML = $(“bar”).style.width;

if($(“bar”).style.width == “100%”){
clearInterval(timer);
}
}
var timer=setInterval(“ck()”,100)
</script>

转载请注明:朝晖运营分享笔记_ 深圳SEO|运营推广 » js实现加载flash显示进度条代码分享

喜欢 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
粤ICP备17061854号