У меня есть эта функция javascript, которая вызывается после ответа ajax.Он содержит этот бит кода:
// If there is a notification already, clear it and restart with the new notification.
try {clearTimeout(timeout_handle);}
catch(err){}
$('#animated_status_message').html(
'this is a status message'
);
$("#animated_status_message").animate({top:"0"},{duration:400})
timeout_handle = setTimeout("$('#animated_status_message').animate({top:'-60px'},{duration:400})", 4000);
Это CSS для div:
#animated_status_message{
background-color: orange;
color: black;
font-weight: bold;
border: 1px solid black;
margin-top: 2px;
padding: 20px;
z-index: 1000;
max-width: 80%;
position:fixed;
opacity:0.92;
}
И, наконец, html:
<div id="animated_status_message" style="top: -60px;"></div>
JavaScriptвероятно, здесь нет необходимости, но на всякий случай.
Итак, проблема в том, что div не центрирован.Я попробовал несколько методов с помощью margin auto и создал родительский div и добавил к нему свойство left и фактический div, содержащий содержимое.
Есть идеи, как связать все это вместе?
Спасибо, Эрик