오른쪽 마우스 클릭시 나타나는 메뉴
작성일 07-08-08 10:33
페이지 정보
작성자서방님 조회 189회 댓글 0건본문
<html>
<head>
<title>http://www.blueb.co.kr</title>
<style>
.skin0 {
position:absolute;
text-align:left;
width:200px;
border:2px solid black;
background-color:menu;
cursor:default;
visibility:hidden;
}
.skin1 {
cursor:default;
font:menutext;
position:absolute;
text-align:left;
width:120px;
background-color:menu;
border:1 solid buttonface;
visibility:hidden;
border:2 outset buttonhighlight;
}
</style>
<script LANGUAGE="JavaScript1.2">
var menuskin = "skin1";
var display_url = 0;
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 = "gray";
event.srcElement.style.color = "black";
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();">
<!--이곳에 메뉴 작성-->
<table width=100% cellpadding=2 cellspacing=1 border=0>
<tr>
<td width=15><img src="http://www.blueb.co.kr/SRC/javascript/image/dot01.gif></td>
<td><A HREF="#">메뉴 1</A></td>
</tr>
<tr>
<td><img src="http://www.blueb.co.kr/SRC/javascript/image/dot01.gif></td>
<td><A HREF="#">메뉴 2</A></td>
</tr>
<tr>
<td><img src="http://www.blueb.co.kr/SRC/javascript/image/dot01.gif></td>
<td><A HREF="#">메뉴 3</A></td>
</tr>
</table>
<!--이곳에 메뉴 작성-->
</div>
<script language="JavaScript1.2">
if (document.all && window.print) {
ie5menu.className = menuskin;
document.oncontextmenu = showmenuie5;
document.body.onclick = hidemenuie5;
}
</script>
</body>
</html>
댓글목록
등록된 댓글이 없습니다.