仿360开机

仿360开机效果

1.布局

<div class="box">
  <span id="close"></span>
  <div class="hd" id="hd">
     <img src="images/b.jpg">
  </div>
  <div class="td" id="td">
      <img src="images/t.jpg">
  </div>
</div>

2.布局页面位置

    .box{
        width:322px;
        position: fixed;
        bottom: 0;
        right: 0;
    }
    span{
        position: absolute;
        top:0;
        right: 0;
        width: 30px;
        height: 20px;
        cursor: pointer;
    }
    <!--cursor表示鼠标的触手样式-->

3.在上一篇中,我们封装了缓动动画,这里我们不再重写一遍缓动框架啦。有需要的回到上一篇缓动框架复制代码 缓动框架

    <!--把缓动框架放到一个js文件中,取名叫Jqurey.js-->
    <script src="Jqurey.js"></script>
    <script>
        window.onload = function () {
        
            <!--获取标签-->
             var span = document.getElementById("close");
    var hd = span.parentNode;
    var td = document.getElementById("td");
            <!--绑定事件-->
             span.onclick = function () {
             <!--书写事件-->
             animate(td,{"height":0},function (){
                 animate(hd,{"width":0});
         });
    }
        
        }
    
    </script>

运行效果


Untitled3.gif
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容