사이트 내 전체검색
[menu] 오른쪽 마우스 클릭시 나타나는 메뉴
로빈아빠
https://cmd.kr/html/162 URL이 복사되었습니다.

본문

<html>
<head>
<style>
.skin0 { position:absolute; text-align:left; width:250px; border:1px solid black; background-color:#EEEEEE;
font-family:Verdana,굴림; font-size:9pt; line-height:20px; cursor:default; visibility:hidden; }

.skin1 { cursor:default;font:menutext; position:absolute; text-align:left; font-family:Verdana,굴림; font-size: 9pt; width:150px;
background-color:#EEEEEE; border:1 solid buttonface; visibility:hidden; border:1 outset buttonhighlight;}

.menuitems { padding-left:15px; padding-right:10px;}
</style>
<SCRIPT LANGUAGE="JavaScript1.2">
var menuskin = "skin1"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?
function showmenuie5() {
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < ie5menu.offsetWidth)
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
else
ie5menu.style.left = document.body.scrollLeft + event.clientX;
if (bottomedge < ie5menu.offsetHeight)
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
else
ie5menu.style.top = document.body.scrollTop + event.clientY;
ie5menu.style.visibility = "visible";
return false;
}
function hidemenuie5() {
ie5menu.style.visibility = "hidden";
}
function highlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "highlight";
event.srcElement.style.color = "white";
if (display_url)
window.status = event.srcElement.url;
}
}
function lowlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "";
event.srcElement.style.color = "black";
window.status = "";
}
}
function jumptoie5() {
if (event.srcElement.className == "menuitems") {
if (event.srcElement.getAttribute("target") != null)
window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
else
window.location = event.srcElement.url;
}
}
</script>
</head>
<body>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5();" style="">
<div class="menuitems" url="링크경로">메뉴01</div>
<div class="menuitems" url="링크경로">메뉴02</div>
<div class="menuitems" url="링크경로">메뉴03</div>
<div class="menuitems" url="링크경로">메뉴04</div>
<div class="menuitems" url="링크경로">메뉴05</div>
</div>
<script language="JavaScript1.2">
if (document.all && window.print) {
ie5menu.className = menuskin;
document.oncontextmenu = showmenuie5;
document.body.onclick = hidemenuie5;
}
</script>
</body>
</html>

댓글목록

등록된 댓글이 없습니다.

Search

Copyright © Cmd 명령어 18.189.43.74