window.resizeTo(iWidth, iHeight)and setTimeout

解决方案 »

  1.   

    呵呵,前些日子有人问过,祝你们幸福L@_@K
    <!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>
        <title>dhtml.window.simulateMinimize.html</title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <h3>窗体打开后 5 秒自动最小化、2 秒后自动还原!注:IE6sp1, FF2 单窗口模式下测试可用。</h3>
        <div id="divShow"></div>
        <script type="text/javascript">
        <!--
    // 如何让网页打开时候最小化,6秒后最大化?
    // 这个改为 0。
    var iTimeoutForMinimize = 5;
    // 这个改为 6。
    var iTimeoutForResume = 2;var oShow = document.getElementById("divShow");
    showMessage();
    var iTimerID = setInterval(showMessage, 1000);
    setTimeout(minimizeWindow, 1000*iTimeoutForMinimize);function showMessage()
    {
        oShow.innerHTML = "Minimize current window after " + iTimeoutForMinimize-- + " seconds.";
    }
    function minimizeWindow()
    {
        clearInterval(iTimerID);
        resizeTo(0, 0);
        moveTo(screen.availWidth, screen.availHeight);
        setTimeout(resumeWindow, 1000*iTimeoutForResume);
    }
    function resumeWindow()
    {
        moveTo(-4, -4);
        resizeTo(screen.availWidth, screen.availHeight);
    }
        //-->
        </script>
    </body>
    </html>
      

  2.   

    <!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>
        <title>dhtml.window.simulateMinimize.html</title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <h3>窗体打开后 自动最小化、6 秒后自动还原!注:IE6sp1, FF2 单窗口模式下测试可用。</h3>
        <div id="divShow"></div>
        <script type="text/javascript">
        <!--
    var iTimeoutForMinimize = 0;
    var iTimeoutForResume = 5;var oShow = document.getElementById("divShow");
    showMessage();
    var iTimerID = setInterval(showMessage, 1000);
    setTimeout(minimizeWindow, 1000*iTimeoutForMinimize);function showMessage()
    {
        oShow.innerHTML = "Minimize current window after " + iTimeoutForMinimize-- + " seconds.";
    }
    function minimizeWindow()
    {
        clearInterval(iTimerID);
        resizeTo(0, 0);
        moveTo(screen.availWidth, screen.availHeight);
        setTimeout(resumeWindow, 1000*iTimeoutForResume);
    }
    function resumeWindow()
    {
        moveTo(-4, -4);
        resizeTo(screen.availWidth, screen.availHeight);
    }
        //-->
        </script>
    </body>
    </html><body
      

  3.   

    <!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> 
            <title> dhtml.window.simulateMinimize.html </title> 
            <meta   name="generator"   content="editplus"   /> 
            <meta   name="author"   content="Gao   YiXiang"   /> 
            <meta   name="email"   content="[email protected]"   /> 
            <meta   name="keywords"   content="javascript   dhtml   dom"   /> 
            <meta   name="description"   content="I   love   web   development."   /> 
    </head> 
    <body> 
            <h3> 窗体打开后   自动最小化、6   秒后自动还原!注:IE6sp1,   FF2   单窗口模式下测试可用。 </h3> 
            <div   id="divShow"> </div> 
            <script   type="text/javascript"> 
            <!-- 
    var   iTimeoutForMinimize   =   0; 
    var   iTimeoutForResume   =   5; var   oShow   =   document.getElementById("divShow"); 
    showMessage(); 
    var   iTimerID   =   setInterval(showMessage,   1000); 
    setTimeout(minimizeWindow,   1000*iTimeoutForMinimize); function   showMessage() 

            oShow.innerHTML   =   "Minimize   current   window   after   "   +   iTimeoutForMinimize--   +   "   seconds."; 

    function   minimizeWindow() 

            clearInterval(iTimerID); 
            resizeTo(0,   0); 
            moveTo(screen.availWidth,   screen.availHeight); 
            setTimeout(resumeWindow,   1000*iTimeoutForResume); 

    function   resumeWindow() 

            moveTo(-4,   -4); 
            resizeTo(screen.availWidth,   screen.availHeight); 

            //--> 
            </script> 
    </body> 
    </html> 完整的
      

  4.   

    <html>
    <head>
    <title>U</title><script language="javascript">
    function ccc() 

    resizeTo(1000, 500);

    resizeTo(0, 0);
    window.setTimeout("ccc()", 3000);</script>
    </head>
    <body style="width:0;height:0"><table border="1" width=0 height=0> 
      <tr> 
        <td style="width:10px;color:red;"> 0 </td> 
        <td> aa </td> 
      </tr> 
      <tr> 
        <td style="width:10px"> 1231234113240 </td> 
        <td> aa </td> 
      </tr> 
    </table> 
     
    </body>
    </html>
      

  5.   

    这个其实挺简单 
    window的窗口操作函数
    resize()  resizeBy()  resizeTo()
    move()    moveBy()    moveTo()
    scroll()  scrollBy()  scrollTo()不过3列排最前的函数某些浏览器版本不支持 用后面的就行了