<SCRIPT LANGUAGE="JavaScript">
var fontSize = 100;
function fontPlus() {
if (fontSize < 160) {
fontSize = fontSize + 10;
setFaceSize();
//table_width();
}
}
function fontMinus() {
if (fontSize > 80) {
fontSize = fontSize - 10;
setFaceSize();
//table_width();
}
}
function setFaceSize(){
style = " td { font-family:굴림; font-size:" + fontSize + "%} ";
style = style + " a { font-family:굴림; text-decoration: none} ";
style = style + " .style44 { font-size:" + fontSize + "% } ";
style = style + " A:hover { font-family:굴림; text-decoration: underline} ";
style = style + " .w { font-family:굴림; color: #ffffff} ";
style = style + " .bgc { font-family:굴림; } ";
style = style + " .bb { background-repeat:no-repeat; background-position:top left} ";
style = style + " TEXTAREA{color:black; background-color:white; border:1px #333333 solid} ";
// style이 결정짓는다.. -제일중요
document.styleSheets[0].cssText= style;
SetCOOKIE("sitefontsize",fontSize,"","/","");
}
function setFontCOOKIE(){
//return;
//DeleteCOOKIE("sitefontsize","/","")
if(GetCOOKIE("sitefontsize") == null)
{
fontSize = 80;
}
else
{
fontSize= GetCOOKIE("sitefontsize");
}
if(GetCOOKIE("sitefontcolor") == null)
fontColorIndex = 0;
else
fontColorIndex= GetCOOKIE("sitefontcolor");
if(GetCOOKIE("sitebgcolor") == null)
bgColorIndex = 0;
else
bgColorIndex= GetCOOKIE("sitebgcolor");
if (fontSize==0)
{
fontSize = 100;
}
//table_width();
fontSize = fontSize * 1;
//alert(fontSize) ;
setFaceSize();
}
function SetCOOKIE (name,value,expires,path,domain) {
document.COOKIE = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "");
}
function GetCOOKIE (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.COOKIE.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.COOKIE.substring(i, j) == arg)
return getCOOKIEVal (j);
i = document.COOKIE.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function getCOOKIEVal (offset) {
var endstr = document.COOKIE.indexOf (";", offset);
if (endstr == -1)
endstr = document.COOKIE.length;
return UNESCAPE(document.COOKIE.substring(offset, endstr));
}
function DeleteCOOKIE (name,path,domain) {
if (GetCOOKIE(name)) {
document.COOKIE = name +
"=" +((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
</SCRIPT>
<a href="#" ="fontPlus();" > + </a>
<a href="#" ="fontMinus();"> - </a>
'Programming > JavaScript' 카테고리의 다른 글
한글입력 금지 (0) | 2008.08.05 |
---|---|
선택영역만 인쇄 (0) | 2008.08.05 |
자주사용하는 스크립트 모음 (0) | 2008.08.05 |
문자열을 변수로 인식시키기 (0) | 2008.08.05 |
자바스크립트로 문자열 검사하기 (0) | 2008.08.05 |