当前位置:软件学习 > Flash >>

flash+javascript实现显示隐藏效果

 代码如下 复制代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>打开与关闭FLASH</title>
<script. type="text/javascript" src="swfobject.js"></script>
</head>

<body>
<div id="flashcontent" ></div>
<button id="showBtn" nclick="showFlash()" >运行</button>
<input id="seeBtn" type="button" nclick="seeFlash()" value="隐藏" />
</body>
<script>
var so=new SWFObject("index.swf","flash","100%","100%","10");
var btn=document.getElementById("showBtn");
function showFlash(){
 if(btn.innerHTML=="运行"){
  so.write("flashcontent");
  btn.innerHTML="关闭";
 }else{
  hideFlash();
 }
}
function hideFlash(){
 document.getElementById("flashcontent").innerHTML="";
 btn.innerHTML="运行";
}
function seeFlash(){
 var _div=document.getElementById("flashcontent");
 var _btn=document.getElementById("seeBtn");
 if(_div.style.display=="none"){
  _div.style.display="";
  _btn.value="隐藏";
 }else{
  _div.style.display="none";
  _btn.value="显示";
 }
}
showFlash();
</script>
</html>


 

补充:flash教程,动画技术
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,