Skip to content

Commit

Permalink
Scroll message list to bottom after receiving message
Browse files Browse the repository at this point in the history
  • Loading branch information
imanel committed Aug 1, 2011
1 parent a12f887 commit 73f0dba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions public/javascripts/application.js
@@ -1,6 +1,7 @@
// Add message to chat
function addMessage(type, header, content) {
$("<li class='" + type + "'><span>" + header + "</span>" + content + "</li>").appendTo("#messages");
$("#messages").prop('scrollTop', $("#messages").prop("scrollHeight"));
};

function runChat(username) {
Expand Down

0 comments on commit 73f0dba

Please sign in to comment.