中文(繁体)
新浪新聞頻道關於香港回歸十週年的圖片Flash+JS效果
<script type="text/javascript"> /** * @author [sina]zhangping1@ * @version v1.1.3 */ if(typeof(sina)! ="object"){var sina={}} sina.$=function(objId){if(!objId){throw new Error("sina.$(String objId)參數必須")} if(document.getElementById) {return eval('document.getElementById("'+objId+'")')}else if(document.layers){return eval("document.layers['"+objId+"']")}else{return eval( 'document.all.'+objId)}} sinaFlash=function(C,v,x,V,c,X,i,O,I,l,o){var z=this;if(!document.createElement| |!document.getElementById){return} z.id=v?v:"";z.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";z.codebase="http://download.macromedia .com/pub/shockwave/cabs/flash/swflash.cab#version="+(c?c:"7")+",0,0,0";z.width=x;z.height=V; z.movie=C;z.bgcolor=X?X:null;z.quality=O?O:"高";z.src=z.movie;z.pluginspage="http:/ /www.macromedia.com /go/getflashplayer";z.type="application/x-shockwave-flash";z.useExpressInstall=i?i:null;z.xir=(I)?I:window.location; z.redirectUrl=l? l:null;z.detectKey=o?o:null;z.escapeIs=false;z.objAttrs={};z.params={};z.flashVars=[];z.flashVarsStr ="";z. embedAttrs={};z.forSetAttribute("id",z.id);z.objAttrs["classid"]=z.classid;z.forSetAttribute("codebase",z.codebase); z.forSetAttribute("寬度",z.width);z.forSetAttribute("height",z.height);z.forSetAttribute("電影",z.movie);z.forSetAttribute("quality", z.quality);z.forSetAttribute( "pluginspage",z.pluginspage);z.forSetAttribute("type",z.type);z.forSetAttribute("bgcolor",z.bgcolor)} sinaFlash.prototype={getFlashHttype={getFlashHtml :function(){var I=this ,i='<object ';for(var l in I.objAttrs){i+=l+'="'+I.objAttrs[l]+'" '} i+='> ';for(var l in I. params){i+='<param name="'+l+'" value="'+I.params[l]+'" /> '} if(I.flashVarsStr!= ""){i+='<param name="FlashVars" value="'+I.flashVarsStr+'" /> '} i+='<embed ';for(var l in I.embedAttrs){i+=l+'= "'+I.embedAttrs[l] +'" '} i+=' ></embed></object>';return i},forSetAttribute:function(I,i){var l=this;I=I. toLowerCase();switch(I){ case "classid":break;case "pluginspage":l.embedAttrs["pluginspage"]=i;break;case "src":l.embedAttrs["src"]=i; l.params["movie"]= i;break;case "電影":l.params["movie"]=i;l.embedAttrs["src"]=i;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 "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 "onscroll":case " onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":l.embedAttrs["type"]=i;break;case "codebase": l.objAttrs["codebase"]= i;break;case "寬度":l.objAttrs["width"]=i;l.embedAttrs["width"]=i;break;case "高度":l.objAttrs ["height"]=i;l .embedAttrs["高度"]=i;break;case "align":l.objAttrs["align"]=i;l.embedAttrs["align"]=i;break; case "vspace":l.objAttrs[ "vspace"]=i;l.embedAttrs["vspace"]=i;break;case "hspace":l.objAttrs["hspace"]=i;l.embedAttrs[" hspace"]=i;break;case "class":l.objAttrs["class"]=i;l.embedAttrs["class"]=i;break;case "title":l.objAttrs["title"] =i;break;case "accesskey" :l.objAttrs["accesskey"]=i;break;case "name":l.objAttrs["name"]=i;l.embedAttrs["name"]=i; break;case "id":l。 :l.params[I]=l .embedAttrs[I]=i}},forGetAttribute:function(i){var I=this;i=i.toLowerCase();if(I.objAttrs[i]!=undefined ){return I.objAttrs[i] }else if(I.embedAttrs[i]!=undefined){return I.embedAttrs[i]}else if(I.embedAttrs!=undefined){return I.embedAttrs[i] }else{return null}},setAttribute :function(I,i){this.forSetAttribute(I,i)},getAttribute:function(i){傳回this.forGetAttribute(i)},addVariable:function(I,ii ){var l=this;if( l.escapeIs){I=escape(I);i=escape(i)} if(l.flashVarsStr==""){l.flashVarsStr=I+"="+i} else{l.flashVarsStr+="&" +I+"="+i} l.embedAttrs["FlashVars"]=l.flashVarsStr},getVariable:function(I){var o=this,i=o.flashVarsStr;if (o.escapeIs){I=轉義(I)} var l=new RegExp(I+"=([^\&]*)(\&?)","i").exec(i); if(o.escapeIs){return unescape( RegExp.$1)} 返回RegExp.$1},addParam:function(I,i){this.forSetAttribute(I,i)},getParam:function(){返回this.forGetAttribute (name)},write:function(i ){var I=this;if(typeof i=="string"){sina.$(i).innerHTML=I.getFlashHtml()}else if(typeof i== "object"){i.innerHTML=I .getFlashHtml()}}} </script> <!-- 焦點圖begin --> <div id="ForusImg">在不支援Flash或Flash版本不夠高的情況下呼叫</div> <script language= "javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var flashFocus = new sinaFlash("/ u/info_img/2009-06/20/ my_flash.swf", "示範", "299", "271", "7", "#ffffff"); flashFocus.addParam("品質", "最佳"); flashFocus.addVariable("picaddress", '/u/info_img/2009-06/20/U1044P1T402D1F9025DT20070630160727.jpg#胡濤錦檢解放軍駐港部隊駐港部隊#http://cnsina.com.com -06 -30/142513345955.shtml'); flashFocus.addVariable("textcolor","0xffffff"); flashFocus.addParam("選單", "假"); flashFocus.write("ForusImg"); //--><!]]> </script> <!-- 焦點圖結束 -->