提示框

function showMsg(msg) {
    var _div =$("<div></div>");
    _div.css({
        'color': '#fff',
        'padding':"3px 5px",
        'border-radius':'5px',
        'background':'#000',
        'position':'fixed',
        'left':'50%',
        'bottom':'20px',
        'transform':'translateX(-50%)'
    })
    $("body").append(_div);
    _div.text(msg);
    _div.css('display', 'block');
    setTimeout(function () {
        _div.css('display', 'none');
    }, 2000);
}
showMsg("hello")

猜你喜欢

转载自blog.csdn.net/m0_37633370/article/details/79281179