css
.toast {
position: fixed;
padding: 0 20px;
font-size: 16px;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: 300px 0 0;
max-width: 450px;
text-align: center;
height: 40px;
line-height: 40px;
padding: 0 10px;
border-radius: 5px;
background-color: #000;
filter: alpha(opacity=90);
-moz-opacity: 0.1;
background-color: rgba(0,.9);
color: #fff;
z-index: 100;
}
js
function toast(txt) {
$("body").prepend("" + txt + "
");
$(".toast").css({"left": ($(window).width() - $(".toast").width())/2});
setTimeout(function () {
$(".toast").remove();
},2000)
}