{"id":1313,"date":"2004-07-07T09:35:49","date_gmt":"2004-07-07T09:35:49","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=1313"},"modified":"2004-07-07T09:35:49","modified_gmt":"2004-07-07T09:35:49","slug":"javascript%eb%a1%9c-%eb%a7%8c%eb%93%a0-%eb%8b%ac%eb%a0%a5","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=1313","title":{"rendered":"javascript\ub85c \ub9cc\ub4e0 \ub2ec\ub825"},"content":{"rendered":"<p>\nsizers<\/p>\n<p>\uc790\ub8cc\uc2e4\uc5d0 \uc62c\ub9b4\ub824 \ud588\ub354\ub2c8 \uc954\uc7a5\uc774 \uba54\uc77c\ub85c \ubcf4\ub0b4\ub77c\ub294\uad70\uc694.. \u314b\u314b <br \/>\n\ubcc4\uac70 \uc544\ub2cc \uac04\ub2e8\ud55c \uc18c\uc2a4\ub77c \uc5ec\uae30 \uc62c\ub9bd\ub2c8\ub2e4. <br \/>\n\uc2f8\uc774\uc6d4\ub4dc \ub2ec\ub825 \ud37c\ub2e4\uac00 1\/10\uac00\ub7c9\uc73c\ub85c \uc555\ucd95\ud588\uc2b5\ub2c8\ub2e4(\uba87\uc77c\ube91\uc774\ucce4\uc2b5\ub2c8\ub2e4.). <br \/>\n\uac1d\uccb4->\ud568\uc218\ub85c \ubc14\uafb8\uace0 \ubd88\ud544\uc694\ud55c \ud568\uc218\ub4e4, \uc804\uc5ed\ubcc0\uc218\ub4e4 \ub2e4 \ube7c\uc11c \uc801\uc6a9\ud558\uae30 \uc26c\uc6b8\uac81\ub2c8\ub2e4. \u314b\u314b <br \/>\n<html><br \/>\n<head><br \/>\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text\/html; charset=euc-kr\"><br \/>\n<\/head><br \/>\n<body><\/p>\n<div id=calStr><\/div>\n<p>\n<script language=\"JavaScript\"><br \/>\n<!--\n\n\n\/\/\uc790\ubc14\ud568\uc218 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc5d0 \ucd94\uac00\ud588\uc73c\uba74 \ud558\ub294 \ud568\uc218\ub35c..<br \/>\nfunction lpad(str,fill,leng)<br \/>\n{<br \/>\n    var n = leng - str.length;<br \/>\n    var out =\"\";<br \/>\n    for (i =0; i < n; i++)  out = out + fill;<br \/>\n    out=out+str;<br \/>\n    return out;<br \/>\n}<br \/>\n\/\/parseInt\uc5d0\uc11c\ub294 '08'\uc744 8\uc9c4\uc218\ub85c \uc778\uc2dd\ud574\uc11c 0\uc774\ub098 NaN\uc744 \ub3cc\ub824\uc900\ub2e4<br \/>\nfunction toInt(str)<br \/>\n{<br \/>\n    i=0;<br \/>\n    while(1)<br \/>\n    {<br \/>\n        if(str.substr(0,1)=='0') {str=str.substr(1,str.length)};<br \/>\n        else break;<br \/>\n        i++;<br \/>\n    }<br \/>\n    return parseInt(str);<br \/>\n}\n\n\n\/\/\uc815\ud6c8\uc774(sizers)\uc640 \ud568\uaed8 \ub2ec\ub825\uc18c\uc2a4 \ud6c4\ub8e8\uafb8\ub85c \ubc43\uae30\uae30.. \u314b\u314b\n\n\n<br \/>\n\/\/\uae30\ub150\uc77c\uc5d0 \ud574\ub2f9\ud558\ub294 \ubc30\uc5f4 \uc804\uc5ed\ubcc0\uc218(\uc774\ub294 \uc11c\ubc84\uc0ac\uc774\ub4dc\uc5d0\uc11c \ub3d9\uc801\uc73c\ub85c \uc0dd\uc131\uc2dc\ucf1c\uc918\uc57c\ud568);<br \/>\n\/\/\uc54c\uc544\uc11c \uc801\uc6a9\uc2dc\ud0ac\uac83...<br \/>\nvar anniversary = new Array(3,7,9,23,25);\n\n\nfunction show_cal(selectDate,calDivObj) \/\/selectDate\uc774\uc288\uac00 \ub418\ub294 \ub0a0\uc9dc, calDivObj\ub2ec\ub825\uc744 \ubfcc\ub9b4 DIV\ud0dc\uadf8 \uc544\uc774\ub514<br \/>\n{<br \/>\n    \/\/\uc804\uc5ed\ubcc0\uc218\ub4e4 \uc138\ud305<br \/>\n    var selectDate = ''+selectDate; \/\/\uc804\uc5ed\ubcc0\uc2181 - \uc774\uc288\uac00 \ub418\ub294 \ub0a0\uc9dc \uc9c0\uc815<br \/>\n    today = new Date();<br \/>\n    toDate = today.getYear() + lpad(''+(today.getMonth()+1),'0',2) + lpad(''+today.getDate(),'0',2); \/\/ \uc624\ub298\ub0a0\uc9dc \uc9c0\uc815<br \/>\n    \/\/alert(toDate);<br \/>\n    if (selectDate == '')<br \/>\n    {<br \/>\n        selectDate=toDate;<br \/>\n    }\n\n\n    var preMonDate;<br \/>\n    var nextMonDate;<br \/>\n    preMonDate= selectDate.substr(0,4)+lpad(''+(toInt(selectDate.substr(4,2))-1),'0',2)+selectDate.substr(6,2);<br \/>\n    nextMonDate= selectDate.substr(0,4)+lpad(''+(toInt(selectDate.substr(4,2))+1),'0',2)+selectDate.substr(6,2);<br \/>\n    \/\/alert(selectDate+\":\"+ preMonDate +\":\"+ nextMonDate);<br \/>\n    if(selectDate.substr(4,2)=='01') preMonDate= (toInt(selectDate.substr(0,4))-1) + '12' + selectDate.substr(6,2);<br \/>\n    if(selectDate.substr(4,2)=='12') nextMonDate= (toInt(selectDate.substr(0,4))+1) + '01' + selectDate.substr(6,2);\n\n\n    \/\/alert(selectDate+\":\"+ preMonDate +\":\"+ nextMonDate);\n\n\n    var firstDay = getFirstDay(selectDate.substr(0,4), selectDate.substr(4,2));            \/\/ \uccab\ubc88\uc9f8 \uc694\uc77c\uc758 \uc22b\uc790\uac12        <br \/>\n    var lastDay = getLastDay(selectDate.substr(0,4), selectDate.substr(4,2));            \/\/ \ub9c8\uc9c0\ub9c9 \uc694\uc77c\uc758 \uc22b\uc790\uac12<br \/>\n    var daysOfMonth = getDaysOfMonth(selectDate.substr(0,4), selectDate.substr(4,2));    \/\/ 28, 29, 30, 31 \uc911 \ud558\ub098<br \/>\n    \/\/alert(firstDay+\":\"+ lastDay +\":\"+ daysOfMonth);<br \/>\n    var calString;\/\/\ub2ec\ub825 HTML\uc744 \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ubcc0\uc218\ub2e4.<br \/>\n    calString=\"\n\n<table border='0' cellspacing='0' cellpadding='0' style='font-size:11px'>\";\n\n\n    calString+=\"\n\n<tr style='color=#0000C6'>\n\n<td colspan='7' align=center>\";<br \/>\n    calString+=\"<a href=\"javascript:show_cal('\"+ (parseInt(selectDate.substr(0,4))-1)+ selectDate.substr(4,4) +\"',\"+ calDivObj.id +\");\">\u25c0\u25c0<\/a>&nbsp;\";<br \/>\n    calString+=\"<a href=\"javascript:show_cal('\"+ preMonDate +\"',\"+ calDivObj.id +\");\">\u25c0<\/a>&nbsp;\";<br \/>\n    calString+=\"<font size='2'><b>\"+selectDate.substr(0,4)+\"<font color='#FF6600'>\"+selectDate.substr(4,2)+\"<\/font><\/b><\/font>&nbsp;\";<br \/>\n    calString+=\"<a href=\"javascript:show_cal('\"+ nextMonDate +\"',\"+ calDivObj.id +\");\">\u25b6<\/a>&nbsp;\";<br \/>\n    calString+=\"<a href=\"javascript:show_cal('\"+ (parseInt(selectDate.substr(0,4))+1)+ selectDate.substr(4,4) +\"',\"+ calDivObj.id +\");\">\u25b6\u25b6<\/a>\";<br \/>\n    calString+=\"<\/td>\n\n<\/tr>\n\n\";\n\n\n    calString+=\"\n\n<tr height='5'>\n\n<td colspan='7'><\/td>\n\n<\/tr>\n\n\";<br \/>\n    calString+=\"\n\n<tr height=19>\";<br \/>\n    calString+=\"\n\n<td width='19' align=center style='color=#C60000'>\uc77c<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center>\uc6d4<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center>\ud654<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center>\uc218<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center>\ubaa9<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center>\uae08<\/td>\n\n\";<br \/>\n    calString+=\"\n\n<td width='19' align=center style='color=#0000C6'>\ud1a0<\/td>\n\n\";<br \/>\n    calString+=\"<\/tr>\n\n\";\n\n\n    \/\/ \ub2ec\ub825 textfield \ucd9c\ub825<br \/>\n    for (var i=0; i < Math.ceil( (firstDay+daysOfMonth)\/7 ); i++) {<br \/>\n        calString+=\"\n\n<tr valign='middle' height='19'>\";<br \/>\n        for (var j=1; j <= 7; j++) {         <br \/>\n            colNum=i*7+j; \/\/\ub2ec\ub825\uc758 \uac01 \uce78\uc758 \uce7c\ub7fc\uc744 \ubc88\ud638\ub85c \uc9c0\uc815\n\n\n            if (colNum>firstDay && colNum<firstDay+daysOfMonth+1) \/\/\ub2ec\ub825\uc5d0 \ub0a0\uc9dc\uac00 \ub098\uc640\uc57c \ub418\ub294 \uc870\uac74<br \/>\n            {<br \/>\n                thisDay=colNum-firstDay; \/\/\uc774\ub0a0\uc758 \ub0a0\uc9dc(\uc22b\uc790)\n\n\n                \/\/\uc694\uc77c\uc758 \uc0c9\uae54\uc744 \uacb0\uc815\ud558\uc790 \u314b\u314b<br \/>\n                if(colNum%7==1) {tdColor=\"C60000\";}<br \/>\n                else if(colNum%7==0) {tdColor=\"0000C6\";}<br \/>\n                else {tdColor=\"333333\";}\n\n\n                \/\/\uae30\ub150\uc77c\uc77c \uacbd\uc6b0\uc5d0 \ub9c1\ud06c\ub97c \uac78\uc5b4\uc8fc\uc790..  \u314b\u314b \uc2a4\ud0c0\uc77c\uc744 \uc54a\uac78\uc5c8\ub354\ub2c8 \uc0c9\uae54\uc774 \ud30c\ub780\uc0c9\uc73c\ub85c@@;; \uc2a4\ud0c0\uc77c\ub3c4 \uc54c\uc544\uc11c..<br \/>\n                for(k=0;k<anniversary.length;k++)<br \/>\n                {<br \/>\n                    if(thisDay==anniversary[k])<br \/>\n                    {<br \/>\n                        thisDay=\"<a href='http:\/\/\uc5b4\ub514\ub85c \uac08\uae4c.. \u3160.\u3160;;'><b>\"+thisDay+\"<\/b><\/a>\";<br \/>\n                        break;<br \/>\n                    }<br \/>\n                }<br \/>\n                calString+=\"\n\n<td align='center' onClick='' style='color=#\"+tdColor+\"' onMouseOver=this.style.background='#e4e4e4'; onMouseOut=this.style.background='#ffffff';>\"+thisDay+\"<\/td>\n\n\";<br \/>\n            }<br \/>\n            else<br \/>\n            {<br \/>\n                calString+=\"\n\n<td><\/td>\n\n\";<br \/>\n            }<br \/>\n            \/\/calString+=\"\n\n<td>\"+colNum+\"<\/td>\n\n\";<br \/>\n        }<br \/>\n        calString+=\"<\/tr>\n\n\";<br \/>\n    }<br \/>\n    calString+=\"<\/table>\n\n\";\n\n\n    \/\/\uc800\uc7a5\ub41c \uc2a4\ud2b8\ub9c1\ubcc0\uc218\ub97c DIV\ub808\uc774\uc5b4\uc5d0 \uc62c\ub9ac\uc790.. <br \/>\n    calDivObj.innerHTML=calString;<br \/>\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ub0a0\uc9dc \uad00\ub828\ub41c \uc5f0\uc0b0 \ud568\uc218\ub4e4\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\nfunction getDaysOfMonth(year, month) { <br \/>\n    var DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];        \/\/ Non-Leap year Month days.. <br \/>\n    var lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];    \/\/ Leap year Month days.. <br \/>\n    \/* <br \/>\n    Check for leap year .. <br \/>\n    1.Years evenly divisible by four are normally leap years, except for... <br \/>\n    2.Years also evenly divisible by 100 are not leap years, except for... <br \/>\n    3.Years also evenly divisible by 400 are leap years. <br \/>\n    *\/ <br \/>\n    if ((year % 4) == 0) {<br \/>\n        if ((year % 100) == 0 && (year % 400) != 0)<br \/>\n            return DOMonth[toInt(month)-1];\n\n\n        return lDOMonth[toInt(month)-1];<br \/>\n    } else <br \/>\n        return DOMonth[toInt(month)-1];<br \/>\n} \n\n\n\/\/ \uccab\ubc88\uc9f8 \uc694\uc77c \uad6c\ud558\uae30<br \/>\nfunction getFirstDay(year, month) {<br \/>\n    var tmpDate = new Date(); <br \/>\n    tmpDate.setDate(1); <br \/>\n    tmpDate.setMonth(toInt(month)-1); <br \/>\n    tmpDate.setFullYear(year); <br \/>\n    return tmpDate.getDay(); <br \/>\n}\n\n\n\/\/ \ub9c8\uc9c0\ub9c9 \uc694\uc77c \uad6c\ud558\uae30<br \/>\nfunction getLastDay(year, month) {<br \/>\n    var tmpDate = new Date(); <br \/>\n    tmpDate.setDate( getDaysOfMonth(year,month) ); <br \/>\n    tmpDate.setMonth(toInt(month)-1); <br \/>\n    tmpDate.setFullYear(year); <br \/>\n    return tmpDate.getDay(); <br \/>\n}<br \/>\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ub0a0\uc9dc \uad00\ub828\ub41c \uc5f0\uc0b0 \ud568\uc218\ub4e4\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/--><br \/>\n<\/script><br \/>\n<script> <br \/>\n\/\/\ud568\uc218\ud638\ucd9c<br \/>\nshow_cal('',calStr);<br \/>\n\/\/\ub0a0\uc9dc\ub97c \uc9c0\uc815\ud558\uace0 \uc2f6\uc73c\uba74 -> show_cal('20040808',calStr);<br \/>\n\/\/calStr\uc740 \ud574\ub2f9 \ub2ec\ub825\uc744 \uc62c\ub824\uc57c \ud558\ub294 div\ub808\uc774\uc5b4(\uc758 ID)<br \/>\n<\/script><\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>sizers \uc790\ub8cc\uc2e4\uc5d0 \uc62c\ub9b4\ub824 \ud588\ub354\ub2c8 \uc954\uc7a5\uc774 \uba54\uc77c\ub85c \ubcf4\ub0b4\ub77c\ub294\uad70\uc694.. \u314b\u314b \ubcc4\uac70 \uc544\ub2cc \uac04\ub2e8\ud55c \uc18c\uc2a4\ub77c \uc5ec\uae30 \uc62c\ub9bd\ub2c8\ub2e4. \uc2f8\uc774\uc6d4\ub4dc \ub2ec\ub825 \ud37c\ub2e4\uac00 1\/10\uac00\ub7c9\uc73c\ub85c \uc555\ucd95\ud588\uc2b5\ub2c8\ub2e4(\uba87\uc77c\ube91\uc774\ucce4\uc2b5\ub2c8\ub2e4.). \uac1d\uccb4->\ud568\uc218\ub85c \ubc14\uafb8\uace0 \ubd88\ud544\uc694\ud55c \ud568\uc218\ub4e4, \uc804\uc5ed\ubcc0\uc218\ub4e4 \ub2e4 \ube7c\uc11c \uc801\uc6a9\ud558\uae30 \uc26c\uc6b8\uac81\ub2c8\ub2e4. \u314b\u314b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1313","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1313"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1313\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}