<html>
<head>
<script>
var currentFontSize = 2;
function zoomUtil(state)
{
var idx = currentFontSize;
var arrFontSize = new Array();
arrFontSize[0] = "9px";
arrFontSize[1] = "10px";
arrFontSize[2] = "12px";
arrFontSize[3] = "14px";
arrFontSize[4] = "16px";
arrFontSize[5] = "18px";
arrFontSize[6] = "20px";
if (state == "plus")
{
if (currentFontSize < 6 )
{
idx = currentFontSize + 1;
currentFontSize = idx;
}
}
else if (state == "default")
{
idx = 2;
currentFontSize = idx;
}
else if (state == "minus")
{
if ( currentFontSize >= 1)
{
idx = currentFontSize - 1;
currentFontSize = idx;
}
}
// 특정 태그가 아니라 전체 페이지의 글자 크기를 모두 조절하고 싶을때..
for (i = 0; i < document.all.length; i++)
{
document.all[i].style.fontSize = arrFontSize [idx];
}
// Body태그 아래의 글자 크기만 조절하고 싶을때..
// document.body.style.fontSize= arrFontSize[idx];
}
</script>
</head>
<body onLoad = "javascript:zoomUtil('default');">
asdfasdfasdfasfadsdfasfdsasfdfasdfas<br>
asdfasfdsadfasdfasdfsaf<br>
<a onClick = "javascript:zoomUtil('plus');" href = "#">[++]</a>
<a onClick = "javascript:zoomUtil('minus');" href = "#">[--]</a>
</body>
</html>
<head>
<script>
var currentFontSize = 2;
function zoomUtil(state)
{
var idx = currentFontSize;
var arrFontSize = new Array();
arrFontSize[0] = "9px";
arrFontSize[1] = "10px";
arrFontSize[2] = "12px";
arrFontSize[3] = "14px";
arrFontSize[4] = "16px";
arrFontSize[5] = "18px";
arrFontSize[6] = "20px";
if (state == "plus")
{
if (currentFontSize < 6 )
{
idx = currentFontSize + 1;
currentFontSize = idx;
}
}
else if (state == "default")
{
idx = 2;
currentFontSize = idx;
}
else if (state == "minus")
{
if ( currentFontSize >= 1)
{
idx = currentFontSize - 1;
currentFontSize = idx;
}
}
// 특정 태그가 아니라 전체 페이지의 글자 크기를 모두 조절하고 싶을때..
for (i = 0; i < document.all.length; i++)
{
document.all[i].style.fontSize = arrFontSize [idx];
}
// Body태그 아래의 글자 크기만 조절하고 싶을때..
// document.body.style.fontSize= arrFontSize[idx];
}
</script>
</head>
<body onLoad = "javascript:zoomUtil('default');">
asdfasdfasdfasfadsdfasfdsasfdfasdfas<br>
asdfasfdsadfasdfasdfsaf<br>
<a onClick = "javascript:zoomUtil('plus');" href = "#">[++]</a>
<a onClick = "javascript:zoomUtil('minus');" href = "#">[--]</a>
</body>
</html>
Trackback URL : http://www.ishappy.net/tc/trackback/27



당신의 의견을 작성해 주세요.