zoukankan      html  css  js  c++  java
  • 滑入滑出效果的弹出窗口

    <script>
    var movwin,targetX,step
    function newwin(w,h){
    movwin=window.open("","demo","width="+w+",height="+h)
    movwin.document.write(subwin.innerHTML)
    movwin.document.close()
    targetX=(screen.width-w)/2
    step=(targetX-movwin.screenLeft)/10
    movwin.moveTo(-w,(screen.height-h)/2)
    moveit()
    }
    function moveit(){
    if(!movwin.closed&&movwin.screenLeft<targetX){
       movwin.moveBy(step,0)
       setTimeout("moveit()",10)
       step=(targetX-movwin.screenLeft)/10
    }
    }
    </script>
    <button onClick="newwin(150,100)">打开滑动窗口</button>
    <xmp style="display:none" id="subwin">
    <script>
    var step=0.1
    function closeit(){
    if(screenLeft<screen.width) {
      step*=1.15
      self.moveBy(step,0)
      setTimeout("closeit()",10)
    }
    else self.close()
    }
    </script> <br><a target=_blank href=http://www.7788ok.com/blog>my bolg</a>
    <button onClick="closeit()">关闭滑动窗口</button>
    </xmp>
  • 相关阅读:
    htop命令使用详解
    三月江南
    linux下文本三剑客之sed
    linux下五种查找命令
    Spring MVC 全局异常处理&文件上传
    About Spring MVC
    JSP
    java多线程
    Java中map接口 遍历map
    log4j
  • 原文地址:https://www.cnblogs.com/MaxIE/p/529162.html
Copyright © 2011-2022 走看看