팝업 닫기열기(popup layer)
<!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
'Web > javascript / jQuery' 카테고리의 다른 글
| 내 기준 유용한 js / jquery 플러그인 (4) | 2016.05.23 | 
|---|---|
| Remove all child elements of a DOM node in JavaScript (4) | 2016.03.28 | 
| autocomplete 함수를 이용한 ajax 비동기 자동완성 (4) | 2016.02.25 | 
| jquery - function 사용법 (6) | 2016.02.18 | 
| 브라우저 종류 및 버전 체크 하는 java script 함수 (6) | 2015.12.15 |