封装一个实用的弹出框

1. 很简单啦啦啦

function alertBox(alertBox_text) {
var alertBox = $(<div class="alertBOX" style="text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width: 3rem;height: 0.6rem;line-height:0.6rem;text-align:center;top:38%;left:18%;background:rgba(0,0,0,0.5);color:rgb(255,255,255);font-size: 12px;position: absolute;z-index: 99">${alertBox_text}</div>)
$(alertBox).appendTo($('.contentRightItem'));
setTimeout(function () {
$('.alertBOX').remove();
},1500)
}

posted @ 2018-07-30 17:31  Panax  阅读(125)  评论(0编辑  收藏  举报