zoukankan      html  css  js  c++  java
  • toast组件较为完美版本

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script src="jquery-3.0.0.min.js"></script>
    <style>
    .toast-container {
      position: fixed;
       100%;
      height: 100%;
      left: 100%;
      top: 100%;
    }
    
    .toast {
      position: absolute;
      top: -50%;
      left: -50%;
      transform: translate(-50%, -50%);
      padding: 13px 16px;
      font-size: 14px;
      color: #ccc;
      background: rgba(37, 38, 45, 0.9);
      border-radius: 2px;
       auto;
      /*可以输入的字数的宽度*/
      max- 20em;
    }
    </style>
    </head>
    
    <body>
    <script>
    var toastcome = function(msg) {
      var str = "<div class='toast-container' style='display:none'> <div class='toast'>" + msg + "</div></div>";
      $('body').append(str);
      $('.toast-container').stop().fadeIn(100).delay(1000).fadeOut(400); //fade out after 3 seconds
      setTimeout(function() {
        $('.toast-container').remove();
      }, 3000);
    }
    // toastcome("你好,我是谁不关你的事情,清理这里是我的责任,谢谢你好,我是谁不关你的事情,清理这里是我的责任,谢谢你好,我是谁不关你的事情,清理这里是我的责任,谢谢");
    toastcome("你好,我是谁");
    </script>
    <div class="toast-container">
      <div class="toast">你好,我是谁不关你的事情,清理这里是我的责任,谢谢</div>
    </div>
    </body>
    
    </html>
    

      

  • 相关阅读:
    CF1187E Tree Painting
    [TJOI2017]城市
    [HNOI2010]合唱队
    2020暑假多校补题记录
    树形dp总结
    2017CCPC 秦皇岛 G. Numbers (贪心 + java大数)
    LOJ 2491 求和 (LCA + 前缀和)
    LOJ 10105. 欧拉回路
    Luogu P3953 逛公园 (最短路+dp)
    LOJ#2718. 「NOI2018」归程 (kruskal重构树)
  • 原文地址:https://www.cnblogs.com/zerohu/p/6269056.html
Copyright © 2011-2022 走看看