From: Dylan Lloyd Date: Thu, 29 Aug 2013 09:43:50 +0000 (+0000) Subject: minor improvements (scroll down on msg) X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=721f3d6317357d40d4bc80d7ebf4e630f6dd1a1f;p=mudd.git minor improvements (scroll down on msg) --- 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); } }); }