From 721f3d6317357d40d4bc80d7ebf4e630f6dd1a1f Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Thu, 29 Aug 2013 09:43:50 +0000 Subject: [PATCH] minor improvements (scroll down on msg) --- index.php | 8 +++----- mud.js | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index ce8a197..8e8360e 100644 --- a/index.php +++ b/index.php @@ -2,11 +2,9 @@ mud - - - + + + diff --git a/mud.js b/mud.js index 45373cc..1fee512 100644 --- a/mud.js +++ b/mud.js @@ -155,7 +155,8 @@ $(document).ready(function(){ $('').addClass(style).text(action), $('').addClass('msg').text(msg) ) - ) + ); + $("#log").animate({ scrollTop: $('#log')[0].scrollHeight}, 1000); } $('#submit').click(function() { var text = $('#chat').val(); @@ -214,6 +215,7 @@ $(document).ready(function(){ var msg = messages[i]; if (msg.id == self.player.id) continue; writeToLog(msg.name + ':', msg.type, msg.message); + $("#log").animate({ scrollTop: $('#log')[0].scrollHeight}, 1000); } }); } -- 2.30.2