팝업 닫기열기(popup layer)

Posted by RAY.D
2016. 2. 25. 14:53 Web/javascript / jQuery
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title> new document </title>
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />

<script type="text/javascript">
<!--
  function open_popup_new(id,w,h){
  var gId = document.getElementById(id);
  var realY = (document.documentElement.clientHeight-h)/2;
  var glayerPopup = gId.className;


  if( gId.style.display == "none" || gId.style.display == "" ){
   gId.style.display = "block";
  } else {
   gId.style.display = "none";
  }

  gId.style.width = (w-10)+"px";
 }

 function close_popup_new(id){
  var gId = document.getElementById(id);
  if( gId.style.display == "none" || gId.style.display == "" ){
   gId.style.display = "block";
  } else {
   gId.style.display = "none";
  }
 }
//-->
</script>
</head>

<body>

<div onclick="open_popup_new('test',610,464); return false;" style="cursor:pointer;">클릭</div>

<div class="write" id="test" style="display:none; width:250px; height:250px;border:solid 2px blue;">
 내용<br />
 <span onclick="close_popup_new('test'); return false;" style="cursor:pointer;">닫기</span>
</div>

 

</body>
</html