⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 12.15 慢慢变大的窗口.htm

📁 一些javascript的小例子希望对初学者有更好的帮助
💻 HTM
字号:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
<script language="javascript">
    var Windowsheight=100;
    var Windowswidth=100;
    var numx=5;
 function openwindow(thelocation){   
   temploc=thelocation;
    if (!(window.resizeTo&&document.all)&&!(window.resizeTo&&document.getElementById)) 
  {     
      window.open(thelocation);   //打开新窗口
      return ;  }   
     windowsize=window.open("","","scrollbars");
     windowsize.moveTo(0,0);     //移动窗口到0,0坐标处
     windowsize.resizeTo(100,100);//改变窗口大小
   tenumxt(); 
 }   
 function tenumxt(){   
    if (Windowsheight>=screen.availHeight-3) //高度超过窗体最大高度时
        numx=0 ; 
     windowsize.resizeBy(5,numx); 
     Windowsheight+=5;     //高度逐次加5
    Windowswidth+=5;      //宽度逐次加5
     if (Windowswidth>=screen.width-5)  {  //宽度超过窗体最大宽度时
        windowsize.location=temploc   
            Windowsheight=100
            Windowswidth=100     
            numx=5     
            return   
       }   
     setTimeout("tenumxt()",50)         //通过计时器,逐渐变大窗口 
   }  
</script>

</head>
<body>
<a href="javascript:openwindow('http://www.google.com')">进入搜索</a>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -