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>
  • 相关阅读:
    es6-箭头函数
    高度自适应的div
    移动端css水平垂直居中
    跨域2-常用的跨域方式
    跨域1-CORS跨域
    前端路由分类
    K8S系列-2.常用命令
    Git多分支管理
    微服务-01初识
    VirtualBox虚拟Centos磁盘文件扩容
  • 原文地址:https://www.cnblogs.com/MaxIE/p/529162.html
Copyright © 2011-2022 走看看