這種效果的警告框,出錯了會抖動
.alert-box {
width: px;
border-style: outset;
position: relative;
color:#555;
border-radius:px;
font-family:Tahoma,Geneva,Arial,sans-serif;font-size:px;
padding:px px px px;
margin:auto;
display: none;
}
.alert-box span {
font-weight:bold;
text-transform:uppercase;
}
.error {
background:#ffecec no-repeat px %;
border:px solid #f5aca6;
}
jQuery的動畫效果,animate for循環4次左右移動
var $box = $('.alert-box');
$box.html('<span>error: </span>' + data.error);
$box.show();
var box_left = ($(window).width() - $box.width()) / ;
for(var i=; >=i; i++){
$box.animate({left:-(-*i)},);
$box.animate({left:+*(-*i)},);
}