팝업메뉴 만들기

</p> <p><script language="JavaScript"> <br /> <!-- <br /> function popupmenu_show(layername) { var obj = document.all[layername]; <br /> var _tmpx,_tmpy, marginx, marginy; _tmpx = event.clientX + parseInt(obj.offsetWidth); <br /> _tmpy = event.clientY + parseInt(obj.offsetHeight); _marginx = document.body.clientWidth - _tmpx; <br /> _marginy = document.body.clientHeight - _tmpy ; if(_marginx < 0) <br /> _tmpx = event.clientX + document.body.scrollLeft + _marginx ; <br /> else <br /> _tmpx = event.clientX + document.body.scrollLeft ; if(_marginy < 0) <br /> _tmpy = event.clientY + document.body.scrollTop + _marginy + 20; <br /> else <br /> _tmpy = event.clientY + document.body.scrollTop ; obj.style.posLeft = _tmpx - 5; <br /> obj.style.posTop = _tmpy; layer_set_visible(obj, true); <br /> layer_set_pos(obj, obj.style.posLeft, obj.style.posTop); <br /> } function layer_set_visible(obj, flag) { <br /> if (navigator.appName.indexOf('Netscape', 0) != -1) { <br /> obj.visibility = flag ? 'show' : 'hide'; <br /> } else { <br /> obj.style.visibility = flag ? 'visible' : 'hidden'; <br /> } <br /> } <br /> function layer_set_pos(obj, x, y) <br /> { <br /> if (navigator.appName.indexOf('Netscape', 0) != -1) { <br /> obj.left = x; <br /> obj.top = y; <br /> } else { <br /> obj.style.pixelLeft = x + document.body.scrollLeft; <br /> obj.style.pixelTop = y + document.body.scrollTop; <br /> } <br /> } function popupmenu_off() { <br /> layer_set_visible(popupmenu, false); <br /> } document.onmousedown = popupmenu_off; // --> <br /> </script> </p><div class="jblov-content" id="ads"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block;" data-ad-client="ca-pub-7362411230876934" data-ad-slot="" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <style> td {font-size:9pt} </style> <p> </head> </p> <p><body data-rsssl=1 bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin=0 topmargin=0> </p> <div id='popupmenu' style='width:100px; height:50px; position:absolute; z-index:1; visibility:hidden;'></p> <table bgcolor='#cccccc' width='100%' cellpadding='5' cellspacing='1'></p> <tr style=cursor:hand></p> <td onmouseover="this.style.background='#333399'; this.style.color='#ffffff'" onmouseout="this.style.background='#cccccc'; this.style.color='#000000'" onmousedown="alert('메롱')">&nbsp;샘플1 </td> </tr> <p> </table> <p> </div> <p><a href="javascript://" onclick="popupmenu_show('popupmenu')">샘플메뉴</a> </p> <p>

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다