From 218298a8e5d1ec81b73cd133cefbf338b8797da1 Mon Sep 17 00:00:00 2001 From: invzhi Date: Wed, 27 Dec 2017 16:13:44 +0800 Subject: [PATCH] Fix mistake in chat example --- examples/chat/home.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/chat/home.html b/examples/chat/home.html index a39a0c2..9d0ecab 100644 --- a/examples/chat/home.html +++ b/examples/chat/home.html @@ -9,9 +9,8 @@ window.onload = function () { var log = document.getElementById("log"); function appendLog(item) { - var doScroll = log.scrollTop > log.scrollHeight - log.clientHeight - 1; log.appendChild(item); - if (doScroll) { + if (log.scrollHeight > log.clientHeight) { log.scrollTop = log.scrollHeight - log.clientHeight; } }