텍스트 사이즈 조절 기능에 원래 크기로 돌리는 기능 추가
This commit is contained in:
1
head.php
1
head.php
@ -163,4 +163,5 @@ if ($config['cf_include_head']) {
|
|||||||
<div id="text_size">
|
<div id="text_size">
|
||||||
<button class="no_text_resize" onclick="font_resize('container', 'increase');">크게</button>
|
<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_resize('container', 'decrease');">작게</button>
|
||||||
|
<button class="no_text_resize" onclick="font_default('container');">기본</button>
|
||||||
</div>
|
</div>
|
||||||
33
js/common.js
33
js/common.js
@ -530,6 +530,10 @@ function font_resize(id, act)
|
|||||||
if(isNaN(count))
|
if(isNaN(count))
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
|
// 크롬의 최소 폰트사이즈 버그로 작게는 한단계만 가능
|
||||||
|
if(count == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
$elements.each(function() {
|
$elements.each(function() {
|
||||||
if($(this).hasClass("no_text_resize"))
|
if($(this).hasClass("no_text_resize"))
|
||||||
return true;
|
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 함수를 반복 할 때 사용
|
* font_resize 함수를 반복 할 때 사용
|
||||||
**/
|
**/
|
||||||
function font_resize2(id, act, loop)
|
function font_resize2(id, act, loop)
|
||||||
{
|
{
|
||||||
// fotn resize 카운트 초기화
|
// font resize 카운트 초기화
|
||||||
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
|
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
|
||||||
|
|
||||||
for(i=0; i<loop; i++) {
|
for(i=0; i<loop; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user