三层菜单的代码。 晕像他那样的菜单很难看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给你一个一级的你自己去作差不多的document.write('<div id="menuDiv" style="position:absolute;z-index:1000;background-color: #FFFFFF;" ></div>');//标题处理结束//下拉菜单相关代码 var h; var w; var l; var t; var topMar = 1; var leftMar = -5; var space = 1; var isvisible; var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色 var global = window.document global.fo_currentMenu = null global.fo_shadows = new Arrayfunction HideMenu() { var mX; var mY; var vDiv; var mDiv; if (isvisible == true) { vDiv = document.all("menuDiv"); mX = window.event.clientX + document.body.scrollLeft; mY = window.event.clientY + document.body.scrollTop; if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)) { vDiv.style.visibility = "hidden"; isvisible = false; } }}function ShowMenu(vMnuCode,tWidth) { vSrc = window.event.srcElement; vMnuCode = "<table id='submenu' bgcolor='ffffff' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1 valign=top >" + vMnuCode + "</td></tr></table>"; h = vSrc.offsetHeight; w = vSrc.offsetWidth; l = vSrc.offsetLeft + leftMar+4; t = vSrc.offsetTop + topMar + h + space-2; vParent = vSrc.offsetParent; while (vParent.tagName.toUpperCase() != "BODY") { l += vParent.offsetLeft; t += vParent.offsetTop; vParent = vParent.offsetParent; } menuDiv.innerHTML = vMnuCode; menuDiv.style.top = t; menuDiv.style.left = l; menuDiv.style.visibility = "visible"; isvisible = true; makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)}function makeRectangularDropShadow(el, color, size){ var i; for (i=size; i>0; i--) { var rect = document.createElement('div'); var rs = rect.style rs.position = 'absolute'; rs.left = (el.style.posLeft + i) + 'px'; rs.top = (el.style.posTop + i) + 'px'; rs.width = el.offsetWidth + 'px'; rs.height = el.offsetHeight + 'px'; rs.zIndex = el.style.zIndex - i; rs.backgroundColor = color; var opacity = 1 - i / (i + 1); rs.filter = 'alpha(opacity=' + (100 * opacity) + ')'; el.insertAdjacentElement('afterEnd', rect); global.fo_shadows[global.fo_shadows.length] = rect; }} 写好了给我看看,有空我做个多级的三级没意思 给我发一份吧,如果现在有三级的,就给我发一份 jsp+mysql的分页问题 ExtJs4 Grid代码运行报错 跪求帮助 json格式的字符串拼接成为URL的问题 onmouseover的问题,在线等,谢谢!!! 最近看上jQuery了。。 关于highchart曲线 后台赋值 求“图片从右向左连续循环滚动的”代码 框架内传值的问题~~:( 制作仿人人网评论框demo的问题!!! 请问如何将json属性值转为二维数组 select 和 text的集成 如何修改HTML文件?
差不多的
document.write('<div id="menuDiv" style="position:absolute;z-index:1000;background-color: #FFFFFF;" ></div>');
//标题处理结束
//下拉菜单相关代码
var h;
var w;
var l;
var t;
var topMar = 1;
var leftMar = -5;
var space = 1;
var isvisible;
var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色
var global = window.document
global.fo_currentMenu = null
global.fo_shadows = new Arrayfunction HideMenu()
{
var mX;
var mY;
var vDiv;
var mDiv;
if (isvisible == true)
{
vDiv = document.all("menuDiv");
mX = window.event.clientX + document.body.scrollLeft;
mY = window.event.clientY + document.body.scrollTop;
if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight))
{
vDiv.style.visibility = "hidden";
isvisible = false;
}
}
}function ShowMenu(vMnuCode,tWidth)
{
vSrc = window.event.srcElement;
vMnuCode = "<table id='submenu' bgcolor='ffffff' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1 valign=top >" + vMnuCode + "</td></tr></table>";
h = vSrc.offsetHeight;
w = vSrc.offsetWidth;
l = vSrc.offsetLeft + leftMar+4;
t = vSrc.offsetTop + topMar + h + space-2;
vParent = vSrc.offsetParent;
while (vParent.tagName.toUpperCase() != "BODY")
{
l += vParent.offsetLeft;
t += vParent.offsetTop;
vParent = vParent.offsetParent;
} menuDiv.innerHTML = vMnuCode;
menuDiv.style.top = t;
menuDiv.style.left = l;
menuDiv.style.visibility = "visible";
isvisible = true;
makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}
function makeRectangularDropShadow(el, color, size)
{
var i;
for (i=size; i>0; i--)
{
var rect = document.createElement('div');
var rs = rect.style
rs.position = 'absolute';
rs.left = (el.style.posLeft + i) + 'px';
rs.top = (el.style.posTop + i) + 'px';
rs.width = el.offsetWidth + 'px';
rs.height = el.offsetHeight + 'px';
rs.zIndex = el.style.zIndex - i;
rs.backgroundColor = color;
var opacity = 1 - i / (i + 1);
rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
el.insertAdjacentElement('afterEnd', rect);
global.fo_shadows[global.fo_shadows.length] = rect;
}
}
三级没意思