[JS] 버튼 하나로 On Off
<script type="text/javascript">
function Layer(onoff){
var lay=document.getElementById(onoff); if(lay.style.visibility=="hidden"){
lay.style.visibility="visible";
}else if(lay.style.visibility="visible"){
lay.style.visibility="hidden";
}
}
</script>
<a href="#" onclick="javascritp:Layer('layer_pop');">layer</a>
<div id="layer_pop" style="border:1px solid #000;width:500px;height:150px;visibility:hidden"></div>
function Layer(onoff){
var lay=document.getElementById(onoff); if(lay.style.visibility=="hidden"){
lay.style.visibility="visible";
}else if(lay.style.visibility="visible"){
lay.style.visibility="hidden";
}
}
</script>
<a href="#" onclick="javascritp:Layer('layer_pop');">layer</a>
<div id="layer_pop" style="border:1px solid #000;width:500px;height:150px;visibility:hidden"></div>
댓글
댓글 쓰기