From e1a2f8eb595a7c377ab51c56888e7d4d2fa89158 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 5 Mar 2013 14:18:38 +0900 Subject: [PATCH] =?UTF-8?q?#204=20=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=ED=81=AC=EA=B8=B0=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=88=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- head.php | 4 +-- js/common.js | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/head.php b/head.php index 7e87ea5f0..92d151a8d 100644 --- a/head.php +++ b/head.php @@ -161,6 +161,6 @@ if ($config['cf_include_head']) {

- - + +
\ No newline at end of file diff --git a/js/common.js b/js/common.js index f713acc62..058368b65 100644 --- a/js/common.js +++ b/js/common.js @@ -519,6 +519,75 @@ var win_poll = function(href) { new_win.focus(); } +/** + * 텍스트 크게 +**/ +function text_increase() +{ + var $elements = $("#container *:visible"); + var fs = tx = unit = ""; + var fsize; + var x = 0; + $elements.each(function() { + if($(this).hasClass("no_text_resize")) + return true; + + fs = $(this).css("font-size"); + tx = $(this).html(); + unit = fs.replace(/[0-9]/g, ""); + fsize = parseFloat(fs.replace(/[^0-9\.]/g, "")); + + if(!fsize) + return true; + + if(tx.search("<") > -1) + return true; + + if(unit == "em") + x = 1; + + nfsize = (fsize * 1.2); + nfsize = nfsize.toFixed(x); + + $(this).css("font-size", nfsize+unit); + }); +} + +/** + * 텍스트 작게 +**/ +function text_decrease() +{ + var $elements = $("#container *:visible"); + var fs = tx = unit = ""; + var fsize; + var x = 0; + $elements.each(function() { + if($(this).hasClass("no_text_resize")) + return true; + + fs = $(this).css("font-size"); + tx = $(this).html(); + unit = fs.replace(/[0-9]/g, ""); + fsize = parseFloat(fs.replace(/[^0-9\.]/g, "")); + + if(!fsize) + return true; + + if(tx.search("<") > -1) + return true; + + if(unit == "em") + x = 1; + + nfsize = (fsize * 0.8); + nfsize = nfsize.toFixed(x); + + $(this).css("font-size", nfsize+unit); + }); +} + + $(function(){ $('.win_point').click(function() { win_point(this.href); @@ -608,4 +677,15 @@ $(function(){ $('.sv').removeClass('sv_on'); } }); + + // 텍스트 리사이즈 + $("#text_increase").click(function() { + text_increase(); + return false; + }); + + $("#text_decrease").click(function() { + text_decrease(); + return false; + }); }); \ No newline at end of file