From e2bbf126250fc37a5e9d0b4eb2cc5734aebb56cd Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 3 May 2013 14:36:42 +0900 Subject: [PATCH] =?UTF-8?q?#448=20=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A6=AC=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=9E=AC?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skin/board/basic/view.skin.php | 23 ++++++++++++++++------- skin/board/gallery/view.skin.php | 23 ++++++++++++++++------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 7909e1dc7..316767c06 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -217,20 +217,29 @@ $(window).load(function() { view_image_resize(); }); -var rtime = new Date(); +var now = new Date(); var timeout = false; -var delta = 200; +var millisec = 200; +var tid; + $(window).resize(function() { - rtime = new Date(); + now = new Date(); if (timeout === false) { timeout = true; - setTimeout(resizeend, delta); + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } }); -function resizeend() { - if (new Date() - rtime < delta) { - setTimeout(resizeend, delta); +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } else { timeout = false; view_image_resize(); diff --git a/skin/board/gallery/view.skin.php b/skin/board/gallery/view.skin.php index 4c44a6e3c..19ecc715b 100644 --- a/skin/board/gallery/view.skin.php +++ b/skin/board/gallery/view.skin.php @@ -215,20 +215,29 @@ $(window).load(function() { view_image_resize(); }); -var rtime = new Date(); +var now = new Date(); var timeout = false; -var delta = 200; +var millisec = 200; +var tid; + $(window).resize(function() { - rtime = new Date(); + now = new Date(); if (timeout === false) { timeout = true; - setTimeout(resizeend, delta); + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } }); -function resizeend() { - if (new Date() - rtime < delta) { - setTimeout(resizeend, delta); +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } else { timeout = false; view_image_resize();