joeh...
Her er et ex. på en højrekliksmenu:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- // RightClickMenu
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"
}
}
function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor=""
event.srcElement.style.color="black"
}
}
function jumptoie5(){
if (event.srcElement.className=="menuitems"){
if (event.srcElement.url != ''){
if (event.srcElement.getAttribute("target")!=null)
window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
else
window.location=event.srcElement.url
}
}
}
// -->
</SCRIPT>
<STYLE TYPE='text/css'>
.cMenu{
position: absolute;
visibility:hidden;
cursor: default;
font: menutext;
width: 165px;
background-color: menu;
border: 1 solid buttonface;
border: 2 outset buttonhighlight;
}
.menuitems{
padding-left:15px;
padding-right:10px;
}
</STYLE>
</head>
<body>
<RightClick>
<!--[if IE]>
<div id="ie5menu" class="cMenu" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="#">anchor</div>
<div class="menuitems" url="url" target="_blank">Link</div>
<HR>
<![endif]-->
<script language="JavaScript">
<!--
if (document.all&&window.print){
ie5menu.className="cMenu"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
//-->
</script>
</RightClick>
</body>
</html>
Den indeholder to links der ikke er dynamiske, men med lidt snilde skulle det jo nok kunne lade sig gøre at lokke 'id' ud af div-en... I det hele taget kan du styre hele formatteringen fra stylesheetet der er angivet i headeren...
/KaptajnB