• 弹出一个淡入淡出的提示框,且自动消失


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <html>
        <head>
        <title>点击按钮弹出一个淡入淡出的提示框,且自动消失丨芯晴网页特效丨CsrCode.Cn</title>
        <SCRIPT>
        var intTimeStep=20;
        var isIe=(window.ActiveXObject)?true:false;
        var intAlphaStep=(isIe)?5:0.05;
        var curSObj=null;
        var curOpacity=null;
        var stopTime=0;
        function startObjMessage(objId)
        {
        curSObj=document.getElementById(objId);
        if(isIe){curSObj.style.cssText='DISPLAY: none; Z-INDEX: 1; FILTER: alpha(opacity=0); POSITION: absolute;';}
        setMessage();
        }
        function setMessage()
        {
        if(isIe){curSObj.filters.alpha.opacity=0;}
        else{curOpacity=0;curSObj.style.opacity=0}
        curSObj.style.display='';
        setMessageShow();
        }
        function setMessageShow()
        {
        if(isIe)
        {
        curSObj.filters.alpha.opacity+=intAlphaStep;
        if (curSObj.filters.alpha.opacity<100) {setTimeout('setMessageShow()',intTimeStep);}
        else{stopTime+=10;if(stopTime<500){setTimeout('setMessageShow()',intTimeStep);}else{stopTime=0;setMessageClose();}}
        }else
        {
        curOpacity+=intAlphaStep;
        curSObj.style.opacity =curOpacity;
        if (curOpacity<1) {setTimeout('setMessageShow()',intTimeStep);}
        else{stopTime+=10;if(stopTime<200){setTimeout('setMessageShow()',intTimeStep);}else{stopTime=0;setMessageClose();}}
        }
        }
        function setMessageClose()
        {
        if(isIe)
        {
        curSObj.filters.alpha.opacity-=intAlphaStep;
        if (curSObj.filters.alpha.opacity>0) {
        setTimeout('setMessageClose()',intTimeStep);
        }
        else {
        curSObj.style.display='none';
        }
        }
        else
        {
        curOpacity-=intAlphaStep;
        if (curOpacity>0) {
        curSObj.style.opacity =curOpacity;
        setTimeout('setMessageClose()',intTimeStep);
        }
        else {
        curSObj.style.display='none';
        }
        }
        }
        </SCRIPT>
        </head>
        <body>
        <table width=80% ID="Table1"><tr><td>预览效果:淡入淡出的弹出消息<br><input type=button onclick="startObjMessage('objDiv')" value="点击弹出消息" ID="Button1" NAME="Button1"></td>
        </tr>
        <tr><td><DIV id="objDiv" style="DISPLAY: none; Z-INDEX: 1; POSITION: absolute; ">
        <img src="/html/txdm_2/images/20100922/1_122131.gif">测试效果<img src="/html/txdm_2/images/20100922/1_122131.gif"></DIV></td></tr>
        </table>
        </body>
        </html>
        <p align="center">本特效由 <a href="http://www.CsrCode.cn" target="_blank">芯晴网页特效</a>丨CsrCode.Cn 收集于互联网,只为兴趣与学习交流,不作商业用途。</p>
        

  • 相关阅读:
    HTTP Digest authentication
    HDU 1520 Anniversary party 树形DP
    Servlet过滤器
    Js apply 方法 具体解释
    java 读取固定目录下的文件(和上篇差点儿相同)
    使用nodeitk进行角点检測
    ~/.local/share/Trash/files
    mv,Directory not empty不能目录覆盖
    cp 提示 overwrite 问题
    cv:显示Linux命令运行进度
  • 原文地址:https://www.cnblogs.com/xianyadan/p/6523049.html
Copyright © 2020-2023  润新知