텍스트 사이즈 조절 기능에 원래 크기로 돌리는 기능 추가

This commit is contained in:
chicpro
2013-03-06 17:55:39 +09:00
parent 10c77f4288
commit 9fabacfb7d
2 changed files with 33 additions and 1 deletions

View File

@ -163,4 +163,5 @@ if ($config['cf_include_head']) {
<div id="text_size">
<button class="no_text_resize" onclick="font_resize('container', 'increase');">크게</button>
<button class="no_text_resize" onclick="font_resize('container', 'decrease');">작게</button>
<button class="no_text_resize" onclick="font_default('container');">기본</button>
</div>

View File

@ -530,6 +530,10 @@ function font_resize(id, act)
if(isNaN(count))
count = 0;
// 크롬의 최소 폰트사이즈 버그로 작게는 한단계만 가능
if(count == -1)
return;
$elements.each(function() {
if($(this).hasClass("no_text_resize"))
return true;
@ -567,12 +571,39 @@ function font_resize(id, act)
}
/**
* 텍스트 기본사이즈
**/
function font_default(id)
{
var act;
var count = parseInt(get_cookie("ck_font_resize_count"));
if(isNaN(count))
count = 0;
// font resize 카운트 초기화
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
if(count > 0)
act = "decrease";
else
act = "increase";
for(i=0; i<Math.abs(count); i++) {
font_resize(id, act);
}
// font resize 카운트 초기화
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
}
/**
* font_resize 함수를 반복 할 때 사용
**/
function font_resize2(id, act, loop)
{
// fotn resize 카운트 초기화
// font resize 카운트 초기화
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
for(i=0; i<loop; i++) {