zoukankan      html  css  js  c++  java
  • js 小工具

    jq toast提示

    css

    #toastTip {
        display: none;
        position: fixed;
        top: 40%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0.1rem .2rem;
        max- 80%;
        line-height: 0.4rem;
        font-size: 0.28rem;
        text-align: center;
        color: #ffffff;
        background-color: rgba(0, 0, 0, .7);
        border-radius: 0.1rem;
        z-index: 100;
    }
    

    js

    /* 
        toast 提示:绑定在window上,使用方法:showMessage('提示信息', time) 
    */
    window.showMessage = function( $msg, $time ){
        $time = $time === 0 ? 0 : ($time || 1000);
        var oDiv = document.createElement("div");
        oDiv.setAttribute("id", "toastTip");
        var oBody = document.getElementsByClassName('wrapper')[0];
        oBody.append(oDiv);
        $('#toastTip').text( $msg );
        $('#toastTip').fadeIn();
        setTimeout(function() {
            $('#toastTip').fadeOut(function(){
                $('#toastTip').remove();
            });
        }, $time);
    }
    
  • 相关阅读:
    Idea中SpringBoot热部署搭建
    Redis 集群搭建
    centos7 vsftp搭建
    Centos 7 安装jdk
    Centos7 安装nginx
    Xshell 连接Linux
    python 的mysql 操作
    NIO/BIO
    java基础-3
    java基础-2
  • 原文地址:https://www.cnblogs.com/lisaShare/p/12827323.html
Copyright © 2011-2022 走看看