求救大虾!研究2天实在搞不出来,跪谢!
我想让子菜单“ 第一项第一项第一项第一项第一项第一项”不要换行,也就是子菜单横向增加。
<html>
<head>
<!--meta http-equiv="Content-Type" content="text/html; charset=utf-8" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" />
<meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" />
<title>导航菜单下拉效果,sky整理收集。</title>
<SCRIPT language=JavaScript>
<!--
//-->
</SCRIPT>
<SCRIPT language=JavaScript>
menuPrefix = 'menu'; // Prefix that all menu layers must start with
// All layers with this prefix will be treated
// as a part of the menu system.
var menuTree, mouseMenu, hideTimer, doHide;
function init() {
ie4 = (document.all)?true:false;
ns4 = (document.layers)?true:false;
document.onmousemove = mouseMove;
if (ns4) { document.captureEvents(Event.MOUSEMOVE); }
}
function expandMenu(menuContainer,subContainer,menuLeft,menuTop) {
// Hide all submenus thats's not below the current level
doHide = false;
if (menuContainer != menuTree) {
if (ie4) {
var menuLayers = document.all.tags("DIV");
for (i=0; i<menuLayers.length; i++) {
if ((menuLayers[i].id.indexOf(menuContainer) != -1) && (menuLayers[i].id != menuContainer)) {
hideObject(menuLayers[i].id);
}
}
}
else if (ns4) {
for (i=0; i<document.layers.length; i++) {
var menuLayer = document.layers[i];
if ((menuLayer.id.indexOf(menuContainer) != -1) && (menuLayer.id != menuContainer)) {
menuLayer.visibility = "hide";
}
}
}
}
// If this is item has a submenu, display it, or it it's a toplevel menu, open it
if (subContainer) {
if ((menuLeft) && (menuTop)) {
positionObject(subContainer,menuLeft,menuTop);
hideAll();
}
else {
if (ie4) {
positionObject(subContainer, document.all[menuContainer].offsetWidth + document.all[menuContainer].style.pixelLeft - 10, mouseY);
}
else {
positionObject(subContainer, document.layers[menuContainer].document.width + document.layers[menuContainer].left + 50, mouseY);
}
}
showObject(subContainer);
menuTree = subContainer;
}
}
function showObject(obj) {
if (ie4) { document.all[obj].style.visibility = "visible"; }
else if (ns4) { document.layers[obj].visibility = "show"; }
}
function hideObject(obj) {
if (ie4) { document.all[obj].style.visibility = "hidden"; }
else if (ns4) { document.layers[obj].visibility = "hide"; }
}
function positionObject(obj,x,y) {
if (ie4) {
var foo = document.all[obj].style;
foo.left = x;
foo.top = y;
}
else if (ns4) {
var foo = document.layers[obj];
foo.left = x;
foo.top = y;
}
}
function hideAll() {
if (ie4) {
var menuLayers = document.all.tags("DIV");
for (i=0; i<menuLayers.length; i++) {
if (menuLayers[i].id.indexOf(menuPrefix) != -1) {
hideObject(menuLayers[i].id);
}
}
}
else if (ns4) {
for (i=0; i<document.layers.length; i++) {
var menuLayer = document.layers[i];
if (menuLayer.id.indexOf(menuPrefix) != -1) {
hideObject(menuLayer.id);
}
}
}
}
function hideMe(hide) {
if (hide) {
if (doHide) { hideAll(); }
}
else {
doHide = true;
hideTimer = window.setTimeout("hideMe(true);", 2000);
}
}
function mouseMove(e) {
if (ie4) { mouseY = window.event.y; }
if (ns4) { mouseY = e.pageY; }
}
function itemHover(obj,src,text,style) {
if (ns4) {
var text = '<nobr><a href="' + src + '" class="' + style + '">' + text + '<\/a><\/nobr>'
obj.document.open();
obj.document.write(text);
obj.document.close();
}
}
onload = init;
//-->
</SCRIPT>
<style type=text/css>
<!--
.menu { position:absolute;left: 0; top: 2;
background: #FFFFFF;
height:50px; margin: 0px 0px; padding: 0px 0px;
border: 1px silver solid;
overflow: visible; clip: rect( )}
.nextMenu {position:absolute;width:100px;top:31px;left:0px;text-align:left;border:1px #F00 dotted;display:none;}
.menu a:visited { font-family: "Tahoma"; font-size: 11px;
text-decoration: none; font-weight: normal;
color: black; background: #E2E2E2;
width: 500px; padding-left: 8px; ; line-height: 220px; border-color: #FFFFFF #666666 #333333 #999999; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; clip: rect( )}
.menu a:hover { font-family: "Tahoma"; font-size: 11px;
text-decoration: none; font-weight: normal;
color: #FFFFFF; background: #009900;
width: 108px; padding-left: 8px; ; line-height: 22px; clip: rect( )}
.menu .border { border: 1px solid #F4F4F4;
border-bottom: 3px solid #808080;
border-right: 1px solid #808080; }
.menu .text { overflow: hidden;
width: 255px; height: 15px; }
.menu .arrow { overflow: hidden;
width: 15px; height: 12px;
padding-left: 5px; padding-top: 3px; }
.menu .arrow img { width: 6px; height: 7px;
border: 0px; } .menu a { font-family: "Tahoma"; font-size: 11px;
text-decoration: none; font-weight: normal;
color: black; background: #E2E2E2;
width: 108px; padding-left: 8px; ; clip: rect( ); border-color: #FFFFFF #666666 #333333 #999999; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; line-height: 22px} .menu a:link { color: #000000; text-decoration: none}
.a { font-size: 12px; float:left; text-decoration: none }
a:link { color: #FFFFFF; text-decoration: none}
a:hover { text-decoration: underline}
a:visited { color: #FFFFFF; text-decoration: none}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<a href="<#ZC_BLOG_HOST#>">站长特效网</a>,站长必备的高质量网页特效和广告代码。zzjs.net,站长js特效。<hr>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#333333" width="778" class="a">
<tr bgcolor="#009830" align="center" valign="bottom">
<td width="31" height="18"> </td>
<td width="166"><a href="#;" onMouseOver="expandMenu(null,'menu1',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第一项</a></td>
<td width="225"><a href="#;" onMouseOver="expandMenu(null,'menu2',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第二项</a></td>
<td width="172"><a href="#;" onMouseOver="expandMenu(null,'menu3',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第三项</a></td>
<!--可以复制上面的做出menu4 menu5 menu6....-->
<td width="119"><a href="http://www.zzjs.net" class="a" >首页</a></td>
<td width="58" height="18"> </td>
</tr>
</table>
<script language="JavaScript">
function getPos(el,sProp) {
var iPos = 0
while (el!=null) {
iPos+=el["offset" + sProp]
el = el.offsetParent
}
return iPos
}
</script>
<!-- 第一开始 -->
<div id="menu1" class="menu" onMouseOut="hideMe();" style="">
<a href="#;" onMouseOver="expandMenu('menu1');">第一项第一项第一项第一项第一项第一项 </a>
<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a>
<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a>
<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a>
</div>
<!-- 第二开始 -->
<div id="menu2" class="menu" onMouseOut="hideMe();">
<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a>
<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a>
<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a>
<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a>
</div>
<!-- 第三开始 -->
<div id="menu3" class="menu" onMouseOut="hideMe();">
<a href="#;" onMouseOver="expandMenu('menu3');">第三项test</a>
<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a>
<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a>
<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a>
</div>
<!--可以复制上面的做出menu4 menu5 menu6....-->
<p class="a">
</body>
</html>
[解决办法]
建议楼主到 HTML版块发帖