📄 menu.jsp
字号:
<%@page contentType="text/html;charset=GBK"%>
<style>
<!--
.skin0{
position:absolute;
width:100px;
border:2px solid black;
background-color: "#660099";
font-family:Verdana;
line-height:20px;
cursor:default;
visibility:hidden;
}
.skin1{
cursor: default;
font: menutext;
position: absolute;
width: 100px;
background-color: "#D9EAEA";
border: 1 solid buttonface;
visibility:hidden;
border: 2 outset buttonhighlight;
text-align:left;
padding-left:10px;
}
.menuitems{
padding-left:0px;
padding-right:0px;
}
.menuindex{
padding-left:0px;
padding-right:10px;
}
-->
</style>
<script language="JavaScript1.2">
//set the skin of the menu (0 or 1, with 1 rendering a default Windows menu like skin)
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
var field;
function showObjects(fieldname){
field = fieldname;
//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<objects.offsetWidth)
//move the horizontal position of the menu to the left by it"s width
objects.style.left=document.body.scrollLeft+event.clientX-objects.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
objects.style.left=document.body.scrollLeft+event.clientX
//same concept with the vertical position
if (bottomedge<objects.offsetHeight)
objects.style.top=document.body.scrollTop+event.clientY-objects.offsetHeight
else
objects.style.top=document.body.scrollTop+event.clientY
objects.style.visibility="visible"
return false
}
function hideObjects(){
objects.style.visibility="hidden"
}
function highlight(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}
function lowlight(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor=""
event.srcElement.style.color="black"
window.status=""
}
}
function writeObjects(){
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
}
*/
if(event.srcElement.url=='close'){
hideObjects();
return;
}
//window.document.getElementById(field).value += event.srcElement.url;
gather(field,event.srcElement.url);
hideObjects();
}
}
</script>
<div id="objects" class="skin0" onMouseover="highlight()" onMouseout="lowlight()" onClick="writeObjects()" width="100">
<div class="menuitems" url="sum">求和汇总</div>
<div class="menuitems" url="avg">求平均值</div>
</div>
<script language="JavaScript1.2">
if (document.all&&window.print){
if (menuskin==0)
objects.className="skin0"
else
objects.className="skin1"
//document.ondblclick=showObjects
document.body.onclick=hideObjects
}
</script>
<body>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -