Mam div class = 'messages'. I dodać datę do tego div poprzez jQuery.append() Oto style:Autoscroll div z jQuery na dole po dodaniu
.messages {
border: 1px solid #dddddd;
padding:10px;
height: 400px;
overflow-x:visible;
overflow-y: scroll;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin-bottom:10px;
font-size:14px;
}
Dla AutoScroll używam taką funkcję:
receiveMessage = function (name, message, type) {
//adding new message
$("#messages").append('<strong>' + name + ": " + '</strong>' + message + '<br>');
/autoscrolling to the bottom
$("#messages").animate({
scrollTop: $("#messages").height()
}, 300);
}
O ~ 20 wiadomości przewijania normalnie, ale po nim "zawiesza się", nowe wiadomości nie są przewijane. Wersja Chrome 19.0.1084.56. Co robię źle? Dzięki!
Czy możesz podać kod HTML lub jeszcze lepiej utworzyć Sprawdzenie testowe w [jsFiddle] (http://jsfiddle.net)? – AbstractChaos
'# messages' i' .messages'- czy je pomieszałeś? – Andreas