《
ie中的flash出现激活框“单击以激活并使用此控件”的解决方法》文章地址:http://www.tfxk.com/wangyesheji/jianzhanjingyan/0302335G2013.htm
--> [
网站建设之] ie中的flash涌现激活框“单击以激活并使用此控件”的解决办法
IE中的Flash呈现激活框“单击以激活并应用此控件”的解决方式。
当鼠标移到网页中的FLASH上时,会出现一个外边框。并有“单击以激活此控件”的提醒。解决方法:
1、新建JS文件:
Java代码 //v1.0 //Copyright 2006 Adobe Systems, Inc. All rights reserved. function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = '<object '; for (var i in objAttrs) str += i + '="' + objAttrs[i] + '" '; str += '>'; for (var i in params) str += '<param name="' + i + '" value="' + params[i] + '" /> '; str += '<embed '; for (var i in embedAttrs) str += i + '="' + embedAttrs[i] + '" '; str += ' ></embed></object>'; document.write(str); } function AC_FL_RunContent(){ var ret = AC_GetArgs ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" , "application/x-shockwave-flash" ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); } function AC_SW_RunContent(){ var ret = AC_GetArgs ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000" , null ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); } function AC_GetArgs(args, ext, srcParamName, classid, mimeType){ var ret = new Object(); ret.embedAttrs = new Object(); ret.params = new Object(); ret.objAttrs = new Object(); for (var i=0; i < args.length; i=i+2){ var currArg = args[i].toLowerCase(); switch (currArg){ case "classid": break; case "pluginspage": ret.embedAttrs[args[i]] = args[i+1]; break; case "src": case "movie": args[i+1] = AC_AddExtension(args[i+1], ext); ret.embedAttrs["src"] = args[i+1]; ret.params[srcParamName] = args[i+1];  ,
IE与FF不兼容网页布局CSS问题; break; case "onafterupdate": case "onbeforeupdate": case "onblur": case "oncellchange": case "onclick": case "ondblClick": case "ondrag": case "ondragend": case "ondragenter": case "ondragleave": case "ondragover": case "ondrop": case "onfinish": case "onfocus": case "onhelp": case "onmousedown": case "onmouseup": case "onmouseover": case "onmousemove": case "onmouseout": case "onkeypress": case "onkeydown": case "onkeyup": case "onload":  ,
IE8中text-align center偏左的解决办法; case "onlosecapture": case "onpropertychange": case "onreadystatechange": case "onrowsdelete": case "onrowenter": case "onrowexit": case ",
IE6绝对定位的bug及其解决办法;onrowsinserted": case "onstart": case "onscroll": case "onbeforeeditfocus": case "onactivate": case "onbeforedeactivate": case "ondeactivate": case "type": case "codebase": ret.objAttrs[args[i]] = args[i+1]; break; case "width": case "height",
IE6灵异事件之歌剧院魅影;: case "align": case "vspace": case "hspace": case "class": case "title": case "accesskey": case "name":  ,
IE6到底支持不支持!important;case "id": case "tabindex": ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1]; break; default: ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];  ,
IE6中PNG图像不透明是什么问题; } } ret.objAttrs["classid"] = classid; if (mimeType) ret.embedAttrs["type"] = mimeType; return ret; } 2、保留为:AC_RunActiveContent.js 3、在所需的页面中增加; <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> 4、在插入FLASH的地位增添: <script type="text/javascript">AC_FL_RunContent( 'codebase',' <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" <param name="movie" value="index.swf"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <embed src="index.swf" width="1002" height="600" quality="high" pluginspage=" </object> </noscript>
//v1.0 //Copyright 2006 Adobe Systems, Inc. All rights reserved. function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = '<object '; for (var i in objAttrs) str += i + '="' + objAttrs[i] + '" '; str += '>'; for (var i in params) str += '<param name="' + i + '" value="' + params[i] + '" /> '; str += '<embed '; for (var i in embedAttrs) str += i + '="' + embedAttrs[i] + '" '; str += ' ></embed></object>'; document.write(str); } function AC_FL_RunContent(){ var ret = AC_GetArgs ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" , "application/x-shockwave-flash" ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); } function AC_SW_RunContent(){ var ret = AC_GetArgs ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000" , null ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); } function AC_GetArgs(args, ext, srcParamName, classid, mimeType){ var ret = new Object(); ret.embedAttrs = new Object(); ret.params = new Object(); ret.objAttrs = new Object(); for (var i=0; i < args.length; i=i+2){ var currArg = args[i].toLowerCase(); switch (currArg){ case "classid": break; case "pluginspage": ret.embedAttrs[args[i]] = args[i+1]; break; case "src": case "movie": args[i+1] = AC_AddExtension(args[i+1], ext); ret.embedAttrs["src"] = args[i+1]; ret.params[srcParamName] = args[i+1]; break; case "onafterupdate": case "onbeforeupdate": case "onblur": case "oncellchange": case "onclick": case "ondblClick": case "ondrag": case "ondragend": case "ondragenter": case "ondragleave": case "ondragover": case "ondrop": case "onfinish": case "onfocus": case "onhelp": case "onmousedown": case "onmouseup": case "onmouseover": case "onmousemove": case "onmouseout": case "onkeypress": case "onkeydown": case "onkeyup": case "onload": case "onlosecapture": case "onpropertychange": case "onreadystatechange": case "onrowsdelete": case "onrowenter": case "onrowexit": case "onrowsinserted": case "onstart": case "onscroll": case "onbeforeeditfocus": case "onactivate": case "onbeforedeactivate": case "ondeactivate": case "type": case "codebase": ret.objAttrs[args[i]] = args[i+1]; break; case "width": case "height": case "align": case "vspace": case "hspace": case "class": case "title": case "accesskey": case "name": case "id": case "tabindex": ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1]; break; default: ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1]; } } ret.objAttrs["classid"] = classid; if (mimeType) ret.embedAttrs["type"] = mimeType; return ret; } 2、保存为:AC_RunActiveContent.js 3、在所需的页面中添加; <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> 4、在插入FLASH的位置添加: <script type="text/javascript">AC_FL_RunContent( 'codebase',' ); //end AC code</script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" width="1002" height="600"> <param name="movie" value="index.swf"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <embed src="index.swf" width="1002" height="600" quality="high" pluginspage=" type="application/x-shockwave-flash" wmode="transparent"></embed> </object> </noscript>
5、页面中的完全代码:
Java代码 <html> <head> <meta http-equiv="Content-Type" ,IE6与W3C标准的盒模型差异;content="text/html; charset=gb2312" /> <title>IE中的Flash出现激活框“单击以激活并使用此控件”的解决方法</title> <!--加载AC_RunActiveContent.js,此为DW自动生成的文件,无需修改,更改文件目录的时候记得修改这里的路径-->,IE6-IE7-IE8-FireFox css的浏览器兼容技巧; <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <style type="text/css"> <!-- body { background-color: #CCCCCC; } --> <,IE6,7下实现white-space pre-wrap;;/style></head> <body>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>IE中的Flash出现激活框“单击以激活并使用此控件”的解决方法</title> <!--加载AC_RunActiveContent.js,此为DW主动天生的文件,无需修改,更改文件目录的时候记得修改这里的路径--> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <style type="text/css"> <!-- body { background-color: #CCCCCC; } --> </style></head> <body>
<!--下面这段JS修正的时候要留神,一共要修改四个处所:
300 是宽度;
200 是高度;
images/killIEBorder 是门路跟文件名,修改时注意,共有两处,还要特殊注意,文件名后面不要加“.swf”,尔后缀已经写在AC_RunActiveContent.js中-->
Java代码 <script type="text/javascript">AC_FL_RunContent( 'codebase','','width','300','height','200','src','images/killIEBorder','quality','high','pluginspage','','wmode','transparent','movie','images/killIEBorder' ); //end AC code</script> <!--碰到阅读器禁用javascript时将调用下面这段<noscript></noscript>内的代码,就是Dreamweaver进级到8.0.2之前咱们插入flash时的那段代码。<param> 标签针对IE起作用,<embed> 标签针对Firefox和Netscape起作用。--> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" <param name="movie" value="images/killIEBorder.swf"> <param name="quality" value=",IE6 IE7 IE8 Firefox专属CSS hack;high"> <param name="wmode" value="transparent"> <embed src="images/killIEBorder.swf" width="300" height="200" quality="high" pluginspage=" </object> </noscript> Tag:单击以激活并使用此控件 单击以激活并使用此控件
(责任编辑:网站建设)
ie中的flash出现激活框“单击以激活并使用此控件”的解决方法相关文章