Top

[HTML] ·¹À̾î·Î ¸¸µç Æ˾÷ÀÔ´Ï´Ù. ÄíÅ°, À̵¿. ¶ç¿ì´Â ½Ã°£ Á¶Àý °¡´É! | Web-Programing
±è°æÈÆ (admin) | Editor | 2013/03/19 16:58:42 | Á¶È¸:4968

  1. <script language="JavaScript">
  2. <!--
  3. var usePop = 1;        // 1À̸é popUP »ç¿ë
  4. var useMonth = 10;     // °øÁöâÀ» »ç¿ëÇÒ ¿ù 10Àº 10¿ùÀÓ
  5. var useDate  = 9;      // °øÁöâÀ» »ç¿ëÇÒ ÀÏ 6Àº  6ÀϱîÁöÀÓ
  6. var useTime  = 10;     // °øÁöâÀÌ ¸Ó¹«¸¦ ½Ã°£ 10Àº 10ÃÊÀÓ
  7. var expiredays = 1;    //°øÁöâ ÇÏ·ç ¾È¶ç¿ì±â ½Ã°£. 1Àº ÇÏ·çÀÓ
  8. var layerTop  = 10;    //»ó´Ü¿¡¼­ ¶³¾îÁø À§Ä¡¸¦ ÀâÀ¸¼¼¿ä
  9. var layerLeft = 10;    //ÁËÃø¿¡¼­ ¶³¾îÁø À§Ä¡¸¦ ÀâÀ¸¼¼¿ä
  10. var layerWidth = 260;  //·¹ÀÌ¾î ³ÐÀÌ
  11. var layerHeight = 260; //·¹ÀÌ¾î ³ôÀÌ
  12. var layerTopBg = "#666666"; //»ó´Ü,ÇÏ´Ü ¹Ù ¹è°æ
  13. var layerPopBg = "#FFFFFF"; //³»¿ë ºÎºÐ ¹è°æ
  14. function startTime()
  15. {
  16.     var cName ="divPop";
  17.     var time = new Date();
  18.     var year = time.getFullYear();
  19.     usedTime = new Date(year,parseInt(useMonth)-1,parseInt(useDate)+1);
  20.     endTime = (usedTime.getTime()-time.getTime())/(24*60*60*1000);
  21.     showTime = Math.ceil(endTime);
  22.     if ( showTime < 0 || usePop != 1)
  23.  {
  24.         document.getElementById('divPop').style.visibility = "hidden";
  25.  }
  26.  else
  27.  {
  28.      cookieIndex = getCookie(cName);
  29.         if ( !cookieIndex )
  30.         {      
  31.             document.getElementById('divPop').style.visibility = "visible";
  32.         }
  33.         else
  34.         {
  35.             document.getElementById('divPop').style.visibility = "hidden";
  36.         }
  37.  }
  38.     document.getElementById('divPop').style.top = layerTop+"px";
  39.     document.getElementById('divPop').style.left = layerLeft+"px";
  40.     document.getElementById('divPop').style.width = layerWidth+"px";
  41.     document.getElementById('popMain').style.height = layerHeight+"px";
  42.     document.getElementById('popTop').style.background = layerTopBg;
  43.     document.getElementById('divPop').style.background = layerPopBg;
  44.     document.getElementById('popBottom').style.background = layerTopBg;
  45.     h= time.getHours();
  46.     m = time.getMinutes();
  47.     s = time.getSeconds();
  48.     closeTime = h*3600+m*60+s;
  49.     closeTime += parseInt(useTime);
  50.     setTimer();
  51. }
  52. function setTimer()
  53. {
  54.     var time = new Date();
  55.  hour = time.getHours();
  56.     min = time.getMinutes();
  57.     sec = time.getSeconds();
  58.     curTime = hour*3600+min*60+sec;
  59.     if ( curTime >= closeTime )
  60.  {
  61.         document.getElementById('divPop').style.visibility = "hidden";
  62.     }
  63.  else
  64.  {
  65.         window.setTimeout("setTimer()",1000);
  66.  }
  67. }
  68. function setCookie( name, value, expiredays )
  69.     var todayDate = new Date(); 
  70.     todayDate.setDate(todayDate.getDate() + expiredays); 
  71.     document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
  72. }
  73. function closeLayer()
  74. {
  75.     if ( document.notice_form.chkbox.checked )
  76.  {
  77.         setCookie("divPop", "os" , expiredays); 
  78.     }
  79.     document.getElementById('divPop').style.visibility = "hidden";
  80. }
  81. isIE  = document.all;
  82. isNN  = !document.all && document.getElementById;
  83. isN4  = document.layers;
  84. var max_zindex = 30;
  85. function drag( mode,e,obj )
  86.     if ( mode == 'start' )
  87.  {
  88.         obj.offsetx = isIE ? event.clientX : e.clientX;
  89.         obj.offsety = isIE ? event.clientY : e.clientY;
  90.         obj.nowX    = parseInt(obj.style.left);
  91.         obj.nowY    = parseInt(obj.style.top);
  92.         obj.dragable = '1';
  93.         var new_zindex = max_zindex + 1;
  94.         obj.style.zIndex = new_zindex;
  95.         max_zindex = new_zindex;
  96.     }
  97.  else if ( mode == 'move' )
  98.  { 
  99.          if ( obj.dragable == '1' )
  100.    {
  101.              var x = isIE ? (obj.nowX + event.clientX - obj.offsetx) : (obj.nowX + e.clientX - obj.offsetx);
  102.              var y = isIE ? (obj.nowY + event.clientY - obj.offsety) : (obj.nowY + e.clientY - obj.offsety);
  103.              var max_winw = document.body.clientWidth - parseInt(obj.style.width);
  104.              var max_winh = document.body.clientHeight - parseInt(obj.style.height);
  105.              if ( x >= 0 && x <=max_winw ) obj.style.left = x;
  106.              if ( y >= 0 && y <=max_winh ) obj.style.top  = y;
  107.          }
  108.     }
  109.  else if ( mode == 'stop' )
  110.  {
  111.         obj.dragable='0'
  112.     }
  113. }
  114. //-->
  115. </script>
  116. </head>
  117. <STYLE type="text/css">
  118. #divPop { position:absolute; border:2px #999999 solid; z-index:999; visibility:visible;
  119.     cursor:move; filter:alpha(Opacity:80,style:0));-moz-opacity:.50;opacity:.50;
  120. }
  121. #divPop #popTop { height: 30px; }
  122. #divPop #popMain { height:270px; }
  123. #divPop #popBottom { height: 40px; }
  124. .topContent { position:relative; top:5px; margin:0 0 0 5px; font-weight:bold; font-size:12px; color:#ffffff; }
  125. .mainContent { margin:5px 0 0 5px; font-weight:normal; font-size:12px; color:#666666; }
  126. .bottomContent { position:relative; top:5px; margin:0 0 2px 0; font-weight:bold; font-size:12px; color:#ffffff; cursor:pointer; text-align:center }
  127. </STYLE>
  128. <body onLoad="startTime();">
  129. <form name="notice_form">
  130. <div id="divPop" style="position:absolute;left:0px;top:0px;z-index:1;width:0px;height:0px;" onSelectStart="return false;" onMouseDown="drag('start',event,this);" onMouseUp="drag('stop',event,this);" onMouseMove="drag('move',event,this);" dragable='0'>
  131.     <div id="popTop">
  132.         <div class="topContent">°øÁö <span id="today" style="font-weight:normal; color:#ff8000"></span></div>
  133.  </div>
  134.     <div id="popMain">
  135.         <div class="mainContent">
  136.         <p>¼­¿ø¿µ °³ÀÎÀü</p>
  137.         <p>Memorandum of an Interstellar Surveyor </p>
  138.         <p> (¾î´À ¼º°£Ãø·®±â»çÀÇ ºñ¸Á·Ï) </p>
  139.         <p> </p>
  140.         <p> Àå ¼Ò: ¸ð¶õ°¶·¯¸® Á¾·Î±¸ °üÈƵ¿ ¹é»óºôµù B1<br>
  141.                       *** °³ÀÎÁ¤º¸º¸È£¸¦ À§ÇÑ ÀüÈ­¹øÈ£ ³ëÃâ¹æÁö *** 
  142.         </p>
  143.         <p>±â °£: 2007. 10. 17(Wed)-10. 23(Tue) </p>
  144.         <p>ÃÊ´ëÀϽÃ: 2007. 10. 17(Wed) pm 6:0</p>
  145.       </div>
  146.  </div>
  147.     <div id="popBottom">
  148.         <div class="bottomContent"> <span style="font-weight:normal">ÀÌ Ã¢Àº</span><span id="stayTime" style="color:#ff8000"></span>ÃÊÈÄ¿¡ 
  149.         ÀÚµ¿À¸·Î ´ÝÈü´Ï´Ù.</span><br>
  150.         <input type="checkbox" name="chkbox" onclick="closeLayer();">
  151.         ¿À´Ã ÇÏ·ç ÀÌ Ã¢À» ¿­Áö ¾ÊÀ½<a href="javascript:closeLayer();"> [´Ý±â]</a> </div>
  152.  </div>
  153. </div>
  154. </form>
  155. <script language="Javascript">
  156. function getCookie( name ) 
  157.     var nameOfCookie = name + "="; 
  158.     var x = 0; 
  159.     while ( x <= document.cookie.length ) 
  160.     { 
  161.         var y = (x+nameOfCookie.length); 
  162.         if ( document.cookie.substring( x, y ) == nameOfCookie )
  163.   { 
  164.             if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
  165.             endOfCookie = document.cookie.length; 
  166.             return unescape( document.cookie.substring( y, endOfCookie ) ); 
  167.         }
  168.         x = document.cookie.indexOf( " ", x ) + 1; 
  169.         if ( x == 0 ) 
  170.         break; 
  171.      } 
  172.      return ""; 
  173. }
  174. function cal()
  175. {
  176.     var t  = new Date();
  177.     var y  = t.getFullYear();
  178.     var m  = t.getMonth(); 
  179.     var d  = t.getDate();
  180.     var dw  = t.getDay();   
  181.     var w;
  182.  switch ( dw )
  183.  {
  184.      case 0: w = " (ìí¿äÀÏ)"; break; 
  185.      case 1: w = " (êÅ¿äÀÏ)"; break; 
  186.      case 2: w = " (ûý¿äÀÏ)"; break; 
  187.      case 3: w = " (â©¿äÀÏ)"; break; 
  188.      case 4: w = " (ÙÊ¿äÀÏ)"; break; 
  189.      case 5: w = " (ÑÑ¿äÀÏ)"; break; 
  190.      case 6: w = " (÷Ï¿äÀÏ)"; break; 
  191.     }
  192.     document.getElementById('today').innerHTML = ""+y+ "³â " + (m+1) + "¿ù " + d + "ÀÏ"+w;
  193. }
  194. cal();
  195. document.getElementById('stayTime').innerHTML = useTime;
  196. </script>
°øÀ¯Çϱâ
°øÀ¯Çϱâ
0
0
0


´ñ±ÛÀ» ºÒ·¯¿À´Â ÁßÀÔ´Ï´Ù.
¡ã ÀÌÀü±Û [Javascript] UTF-8 -> EUC-KR ÆäÀÌÁö·Î PARAM Àü¼Û Áø±â¿ø (jjinki) 2013-03-20 16:59:53
¡å ´ÙÀ½±Û [MSSQL] ORACLE, MSSQL ÇÔ¼ö ºñ±³ ±è°æÈÆ (admin) 2013-03-18 09:09:22