CSDN博客

img rmzhang33

自动展开的窗口

发表于2004/9/15 12:00:00  467人阅读

分类: javascript部分

自动展开的窗口

源作者:追风                   人气:8328

<script>
  <!--
  var winheight = 100
  var winsize = 100
  var y = 5
  var mylocation;
  function go(url) {
    win2=window.open("","","scrollbars")
    if (!document.layers&&!document.all){
      win2.location = mylocation
      return
    }
    win2.resizeTo(100,100)
    win2.moveTo(0,0)
    mylocation = url;
    go2()
  }


  function go2(){
    if (winheight >= (screen.availHeight - 30))
      y = 0
    win2.resizeBy(5, y)
    winheight += 5
    winsize += 5
    if (winsize >= (screen.width - 5)) {
      win2.location = mylocation;
      winheight = 100
      winsize = 100
      y = 5
      return
    }
    setTimeout("go2()",50)
  }
  //-->
  </script>

说明:上面代码放到<head>区
按钮代码:<input type="button" value="看看效果" name="B2" onclick="go("go.htm")">
你也可以用<body onload="go("go.htm")">调用函数

阅读全文
0 0

相关文章推荐

img
取 消
img