From 2ffc36d4eabd6ca25c72214418f9382a7520195f Mon Sep 17 00:00:00 2001 From: jonsowman Date: Mon, 31 May 2010 16:40:36 +0100 Subject: [PATCH] Made a function for scrolling div to bottom --- predict/js/pred.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/predict/js/pred.js b/predict/js/pred.js index aeb6602..80dd5b5 100644 --- a/predict/js/pred.js +++ b/predict/js/pred.js @@ -222,7 +222,11 @@ function appendDebug(appendage, clear) { $("#debuginfo").html(""); } // keep the debug window scrolled to bottom - $("#scenario_template").animate({scrollTop: $('#scenario_template')[0].scrollHeight}); + scrollToBottom("scenario_template"); + } + +function scrollToBottom(div_id) { + $("#"+div_id).animate({scrollTop: $("#"+div_id)[0].scrollHeight}); } function toggleWindow(window_name, linker, onhide, onshow, force) {