Hi everybody,
ok, I guess everyone knows about this script that let you make your own right click menu:
<style>
.skin0{
position: absolute;
width: 150px;
border: 2px solid black;
font-family: Verdana;
font-size: 10px;
line-height: 10px;
cursor: hand;
visibility: hidden;
background-color:red;
}
.skin1{
cursor: default;
font: menutext;
position: absolute;
width: 165px;
background-color: orange;
border: 1 solid buttonface;
visibility:hidden;
border: 2 outset buttonhighlight;
border-color: #000000;
}
.menuitems{
padding-left:20px;
padding-right:10px;
}
</style>
<script language="JavaScript">
// set the skin of the menu (0 or 1)
var menuskin=1
// set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=1
function showmenuie5() {
// Find out how close the mouse is to the corner of the window
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
// if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<ie5menu.offsetWidth)
// move the horizontal position of the menu to the left by it's width
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
// position the horizontal position of the menu where the mouse was clicked
ie5menu.style.left=document.body.scrollLeft+event.clientX
// same concept with the vertical position
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="red"
if (display_url==1)
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 bgcolor=white>
<font face=verdana size=-2 color=black>this is some text, right click on this page</font>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="blah.html">exodusinternet.com</div>
<hr color=black>
<div class="menuitems" url="blah.html">What's New?</div>
<hr color=black>
<div class="menuitems" url="blah.html">What's Hot?</div>
<hr color=black>
<div class="menuitems" url="blah.html">Message Forum</div>
<hr color=black>
<div class="menuitems" url="blah.html">FAQs</div>
<hr color=black>
<div class="menuitems" url="blah.html">Submit</div>
<hr color=black>
<div class="menuitems" url="blah.html">Email Us</div>
</div>
<script language="JavaScript1.2">
if (document.all&&window.print){
if (menuskin==0)
ie5menu.className="skin0"
else
ie5menu.className="skin1"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
</script>
My question: How can I make a submenu?
Thanks
Yannick dupont
ok, I guess everyone knows about this script that let you make your own right click menu:
<style>
.skin0{
position: absolute;
width: 150px;
border: 2px solid black;
font-family: Verdana;
font-size: 10px;
line-height: 10px;
cursor: hand;
visibility: hidden;
background-color:red;
}
.skin1{
cursor: default;
font: menutext;
position: absolute;
width: 165px;
background-color: orange;
border: 1 solid buttonface;
visibility:hidden;
border: 2 outset buttonhighlight;
border-color: #000000;
}
.menuitems{
padding-left:20px;
padding-right:10px;
}
</style>
<script language="JavaScript">
// set the skin of the menu (0 or 1)
var menuskin=1
// set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=1
function showmenuie5() {
// Find out how close the mouse is to the corner of the window
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
// if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<ie5menu.offsetWidth)
// move the horizontal position of the menu to the left by it's width
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
// position the horizontal position of the menu where the mouse was clicked
ie5menu.style.left=document.body.scrollLeft+event.clientX
// same concept with the vertical position
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="red"
if (display_url==1)
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"
window.open(event.srcElement.url,event.srcElement.getAttribute("target"
else
window.location=event.srcElement.url
}
}
</script>
</head>
<body bgcolor=white>
<font face=verdana size=-2 color=black>this is some text, right click on this page</font>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="blah.html">exodusinternet.com</div>
<hr color=black>
<div class="menuitems" url="blah.html">What's New?</div>
<hr color=black>
<div class="menuitems" url="blah.html">What's Hot?</div>
<hr color=black>
<div class="menuitems" url="blah.html">Message Forum</div>
<hr color=black>
<div class="menuitems" url="blah.html">FAQs</div>
<hr color=black>
<div class="menuitems" url="blah.html">Submit</div>
<hr color=black>
<div class="menuitems" url="blah.html">Email Us</div>
</div>
<script language="JavaScript1.2">
if (document.all&&window.print){
if (menuskin==0)
ie5menu.className="skin0"
else
ie5menu.className="skin1"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
</script>
My question: How can I make a submenu?
Thanks
Yannick dupont