• JS---案例:开机动画


    案例:开机动画

    由上下两部分组成,先下面的高变为0 ,再最大的div宽为0,形成一个缩小到没有的动画效果

    点击的X是在背景图上的,在上面设置了一个空的span用于注册点击事件

    <!DOCTYPE html>
    <html>
    
    <head lang="en">
      <meta charset="UTF-8">
      <title></title>
      <style>
        .box {
          width: 322px;
          position: fixed;
          bottom: 0;
          right: 0;
          overflow: hidden;
        }
    
        span {
          position: absolute;
          top: 0;
          right: 0;
          width: 30px;
          height: 20px;
          cursor: pointer;
        }
      </style>
    </head>
    
    <body>
      <div class="box" id="box">
        <span id="closeButton"></span>
        <div class="hd" id="headPart">
          <img src="images/t.jpg" alt="" />
        </div>
        <div class="bd" id="bottomPart">
          <img src="images/b.jpg" alt="" />
        </div>
      </div>
      <script src="common.js"></script>
      <script>
    
        my$("closeButton").onclick = function () {
          //设置最下面的div高渐渐变为0,里面加个回掉函数
          animate(my$("bottomPart"), { "height": 0 }, function () {
            animate(my$("box"), { "width": 0 });
          });
        };
    
      </script>
    </body>
    
    </html>
  • 相关阅读:
    两个51相互之间单片机如何进行串口通信
    (stm32f103学习总结)—stm32pwm
    (stm32f103学习总结)—stm32 PMW输出实验
    cpu指令如何读写硬盘
    线程进程同步
    stm32+lwip
    opc
    open62541-server编程
    linux 下time函数
    close与shutdown
  • 原文地址:https://www.cnblogs.com/jane-panyiyun/p/12081682.html
Copyright © 2020-2023  润新知