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>
    

      

  • 相关阅读:
    关于Update语句在不同数据库中的差别
    MSIL指令速查表
    一个对于博客园的建议
    代码风格关于if语句
    关于Page.cs文件中注释的一点补充
    在Java、C#和C++中遍历集合
    BPEL4WS的开源Java实现
    【Linux】linux固定ip
    【Linux】【MySQL】MySQL主从数据库
    wpf 写个简单的控件吧
  • 原文地址:https://www.cnblogs.com/zerohu/p/6269056.html
Copyright © 2011-2022 走看看