ÄíŰ¿¡ °ªÀ» ÁÖ°í ±× °ªÀ» ºñ±³Çؼ °è¼Ó ¿·ÁÀְųª ´ÝÇô ÀÖ°Ô²û ÇÏ·Á´Âµ¥¿ä.
´Ý±â´Â µÇ´Âµ¥ ´Ù½Ã ¿¸®Áö°¡ ¾Ê³×¿ä,¤Ð
ÄíŰ °ªµµ ±×´ë·Î 0À̰í 1·Î ¹Ù²îÁö ¾Ê±¸¿ä..
ÀÎÅÍ³Ý º¸¸é¼ Â¥Áý±âÇØ¼ ¸¸µé¾ú´Âµ¥ ¾îµð°¡ Ʋ¸°°É±î¿ä..
»ç¿ë¹ýÀÌ Æ²¸°°É±î¿ä?
ÄíŰ¿¡ °ªÀ» ÁÖ°í ±× °ªÀ» ºñ±³Çؼ °è¼Ó ¿·ÁÀְųª ´ÝÇô ÀÖ°Ô²û ÇÏ·Á´Âµ¥¿ä.
´Ý±â´Â µÇ´Âµ¥ ´Ù½Ã ¿¸®Áö°¡ ¾Ê³×¿ä,¤Ð
ÄíŰ °ªµµ ±×´ë·Î 0À̰í 1·Î ¹Ù²îÁö ¾Ê±¸¿ä..
ÀÎÅÍ³Ý º¸¸é¼ Â¥Áý±âÇØ¼ ¸¸µé¾ú´Âµ¥ ¾îµð°¡ Ʋ¸°°É±î¿ä..
»ç¿ë¹ýÀÌ Æ²¸°°É±î¿ä?
[ ¡å Áú¹®°ü·Ã Âü°í Source ]
//cookie.js
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) { //while open
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
} //while close
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" :
("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function checkCookie(name) //ÄíŰÀÇ Á¸Àç À¯¹«¸¦ ¾Ë¾Æ³»´Â ÇÔ¼ö¸¦ ¸¸µì´Ï´Ù.
{
var nameOfCookie = name + "=";
var x = 0;
while(x <= document.cookie.length)
{
var y = (x + nameOfCookie.length);
if(document.cookie.substring(x,y) == nameOfCookie)
{
if((endOfCookie = document.cookie.indexOf(";",y)) == -1)
endOfCookie = document.cookie.length;
return unescape(document.cookie.substring(y,endOfCookie));
}
x = document.cookie.indexOf(" ",x) + 1;
if(x == 0)
break;
}
return "";
}
function DelCookie(cKey) {
var date = new Date();
var validity = -1;
date.setDate(date.getDate() + validity);
document.cookie =
cKey + "=;expires=" + date.toGMTString();
}
//sidebar
if (checkCookie("sidebar_oc") != "ok" )
{
SetCookie('sidebar_oc', 0);
var checkSidebar = GetCookie("sidebar_oc");
} else {
var checkSidebar = GetCookie("sidebar_oc");
}
var side_content = function() {
var __sidecontent = document.getElementById('sidecontent');
var __sidebtn = document.getElementById('_sidebtn');
if (checkSidebar=1)
{
__sidecontent.style.display = "block";
__sidebtn.src="<?=$g4[path]?>/img/btn_side_close.png";
} else if (checkSidebar=0)
{
__sidecontent.style.display = "none";
__sidebtn.src="<?=$g4[path]?>/img/btn_side_open.png";
}
function sideOnOff(checkSidebar) {
if (checkSidebar=1)
{
DelCookie('sidebar_oc');
SetCookie('sidebar_oc', 0);
side_content();
} else if (checkSidebar=0)
{
DelCookie('sidebar_oc');
SetCookie('sidebar_oc', 1);
side_content();
}
//onoff button
<a href="javascript:sideOnOff(checkSidebar);">