网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 用hta实现的桌面漂浮flash
范文
    用window.createPopup()成功实现了在桌面显示一个无窗口的flash.
    将下面的代码,保存为qq.hta,双击运行即可。关闭方法,任务管理器中关闭mshta.exe即可。
    代码如下:
    <HTA:APPLICATION ID="oHTA"
    APPLICATIONNAME="myApp"
    BORDER="none"
    CAPTION="no"
    ICON="filename.ico"
    MAXIMIZEBUTTON="no"
    MINIMIZEBUTTON="no"
    SHOWINTASKBAR="no"
    INGLEINSTANCE="no"
    SYSMENU="no"
    VERSION="1.0"
    WINDOWSTATE="minimize"
    />
    <script language="JavaScript" type="text/JavaScript">
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    var imagewidth=200 //这两行写弹出窗口的大小
    var imageheight=200
    var speed=3;
    var isie=0;
    if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
    isie=1;
    }
    else {
    isie=0;
    }
    function pop() {
    if(isie) {
    x=x+dx;y=y+dy;
    oPopup.show(x, y, imagewidth, imageheight);
    if(x+imagewidth+5>screen.width) dx=-dx;
    if(y+imageheight+5>screen.height) dy=-dy;
    if(x<0) dx=-dx;
    if(y<0) dy=-dy;
    startani=setTimeout("pop();",50);
    }
    }
    if(isie) {
    var str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="/uploads/202504/02/swflash3708.cab" width="200" height="200"><param name="movie" value="http://files.jb51.net/demoimg/200912/qqpet.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><PARAM NAME=bgcolor value=#FFFFFF><embed src="http://files.jb51.net/demoimg/200912/qqpet.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="190"></embed></object>';
    var x=0,y=0,dx=speed,dy=speed;
    var oPopup = window.createPopup();
    var oPopupBody = oPopup.document.body;
    //oPopup.document.bgColor="orange"; //桔黄色背景颜色
    oPopup.document.bgColor="#ffffff"; //白色背景
    oPopupBody.innerHTML = str;
    pop();
    }
    </script>
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/14 2:03:18