JavaScript

레이어 팝업(1)
  • 조회수 6,183
  • 작성일 2008-08-03
  •  

<Div id="Pop" style="position:absolute; left:100px; top:100px; width:100px; height:100px; z-index:1;display:none;">
   <img src="bu_save.gif">
</Div>

<script>
  function ViewLayer(){
 //만일 Pop라는 녀석이 닫혀있다면??
 if(document.getElementById("Pop").style.display=="none"){
    //열어주어라
    document.getElementById("Pop").style.display='inline'
 //그렇지 않은 모든 경우라면??
 }else{
    //닫아주어라
    document.getElementById("Pop").style.display='none'
 }
 }
</script>

<a href="javascript:ViewLayer();">열어주세요</a>