一个小小弹出层提示框

来源:互联网 发布:python大数据分析 编辑:程序博客网 时间:2024/05/16 10:20

一个小小弹出层提示框,弹出三秒后自动关闭,根据具体情况而定位置

var showMsg = function( _msg ){    $('<div />').attr('id', 'showMsg')    .css({position: 'absolute', margin:'-28px 0 0 110px', padding: '5px 25px', 'font-size': '14px', 'font-weight': 'bold', 'color': '#dd4b4b', border: '1px solid #dd4b4b', background: '#ffd5d2', zIndex: '1000'})    .text(_msg)    .appendTo( $('#Msg') );    setTimeout( function(){    $('#showMsg').fadeOut('slow', function(){    $('#Msg').find('#showMsg').remove();    });    }, 2000)};