搜索
首页web前端html教程js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose

js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦~~
单独的菜单是可以的,放入页面中就不正常了,是怎么回事呀,高手帮忙~~
蛋糕目录中是正常的,在关于我们里就弹一下就没了显示,是啥原因呀[img=http://hi.csdn.net/space-4200912-do-album-picid-1082995-goto-down.html][/img]

<!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><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Chinaz菜单导航</title><style type="text/css"><!--div, ul, p{    margin: 0;    padding: 0;    font-weight: normal;    font-style: normal;    font-size: 100%;    font-family: inherit;}/* Nav==========================================================*/.nav {width:990px;    position: relative; margin:0px auto;}.navinner { background-color:#000000;}.navlist {    height: 45px;    line-height: 36px;    overflow: hidden;    	}.nav li {    float: left;    display: inline;    margin: 0 0 0 -2px;}.nav a {    display: block;    width: 200px;    text-align: center;    font-size: 120%;}.nav a:link, .nav a:visited {    color: #fff;}.nav a.current, .nav a:hover, .nav a:active {    color: #fff;    font-weight: bold;}.subnav {    position: absolute;    top: 41px;    left: 0;    float: left;    height: 30px; width:990px;    line-height: 28px;    white-space: nowrap;	background-color:#1b0908;}* html .subnav {    margin: 0 10px 0 -10px; /* IE 6 and below */}.subnav p {    padding: 0 10px;}.subnav p span {    display: block;}.subnav p.pointer {    position: absolute;    top: 5px;    left: 0;    height: 5px;    width: 11px;    padding: 0;    margin-left: 20px;    text-indent: -999em;    }.subnav a {    display: inline;    padding: 0;    font-size: 100%;}[class~="subnav"] a {  }.subnav, .subnav a:link, .subnav a:visited {    color: #235e99;}.subnav a:hover, .subnav a:active {    color: #235e99;}.subnav a:hover, .subnav a:active {    font-weight: normal;    background: none;    }/* subnav position and pointer position */#subnav1 { left: auto; right: 0px; }#subnav2 { left: auto; right: 0px; }#subnav3 { left: auto; right: 0px; }#subnav4 {left: auto;  right: 0px;}#subnav5, #subnav6, #subnav7 {     left: auto;    right: 0px;}#subnav1 .pointer,#subnav2 .pointer,#subnav3 .pointer,#subnav4 .pointer { left: auto; }#subnav5 .pointer { left: auto; right: 290px; }#subnav6 .pointer { left: auto; right: 180px; }#subnav7 .pointer { left: auto; right: 70px; }#subnav1, #subnav2, #subnav3, #subnav4 {    min-width: 110px;}#subnav5 { min-width: 340px; }#subnav6 { min-width: 240px; }#subnav7 { min-width: 130px; }/* Note==========================================================*/.note {    margin: 0 15px 10px; color:#666666;}.note span{ float:right;}.disable {    display: none;}--></style><script type="text/javascript"><!--function $(id) {    return document.getElementById(id);}function showMenu (baseID, divID) {    baseID = $(baseID);    divID  = $(divID);    if (showMenu.timer) clearTimeout(showMenu.timer); hideCur();    divID.style.display = 'block'; showMenu.cur = divID;    if (! divID.isCreate) {        divID.isCreate = true;        //divID.timer = 0;        divID.onmouseover = function () {            if (showMenu.timer) clearTimeout(showMenu.timer);   hideCur();            divID.style.display = 'block';        };        function hide () {            showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);        }        divID.onmouseout = hide;        baseID.onmouseout = hide;    } function hideCur () {  showMenu.cur && (showMenu.cur.style.display = 'none'); }}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}//--></script></head><body ><div onload="MM_preloadImages('images/1_.gif','images/2_.gif','images/_1_ .gif','images/3_.gif','images/4_.gif','images/5_.gif','images/6_.gif','images/_2_ .gif','images/_3_ .gif','images/_4_ .gif','images/_01_.gif','images/_02_.gif','images/_03_.gif','images/_04_.gif')"><div class="nav"><div class="navinner">  <ul class="navlist">  <li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','images/1_.gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/1.gif"  class="lazy"   name="Image1"  border="0" id="Image1" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a></li>  <li><a href="product.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','images/2_.gif',1)" onClick="showMenu('Image2','subnav1')"><img  src="/static/imghwm/default1.png"  data-src="images/2.gif"  class="lazy"   name="Image2"  border="0" id="Image2" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a>    <div class="subnav disable" id="subnav1">      <p class="pointer">.</p>      <p><span>      <a href="" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','images/_1_ .gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_1.gif"  class="lazy"   name="Image7"    style="max-width:90%"  style="max-width:90%" border="0" id="Image7" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>      <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','images/_2_ .gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_2.gif"  class="lazy"   name="Image8"    style="max-width:90%"  style="max-width:90%" border="0" id="Image8" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>       <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','images/_3_ .gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_3.gif"  class="lazy"   name="Image9"    style="max-width:90%"  style="max-width:90%" border="0" id="Image9" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>      <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','images/_4_ .gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_4.gif"  class="lazy"   name="Image10"    style="max-width:90%"  style="max-width:90%" border="0" id="Image10" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>      </span></p>    </div>    </li>   <li><a href="activity.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','images/3_.gif',1)" onClick="showMenu('Image3','subnav2')"><img  src="/static/imghwm/default1.png"  data-src="images/3.gif"  class="lazy"   name="Image3" border="0" id="Image3" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a>    </li>   <li><a href="jifen.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/4_.gif',1)" onClick="showMenu('Image4','subnav3')"><img  src="/static/imghwm/default1.png"  data-src="images/4.gif"  class="lazy"   name="Image4"  border="0" id="Image4" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a>      </li>  <li><a href="about_us.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','images/5_.gif',1)" onClick="showMenu('Image5','subnav4')"><img  src="/static/imghwm/default1.png"  data-src="images/5.gif"  class="lazy"   name="Image5"  border="0" id="Image5" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a>    <div class="subnav disable" id="subnav4">      <p class="pointer">.</p>      <p><span>      <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image11','','images/_01_.gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_01.gif"  class="lazy"   name="Image11"    style="max-width:90%"  style="max-width:90%" border="0" id="Image11" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>       <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image12','','images/_02_.gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_02.gif"  class="lazy"   name="Image12"    style="max-width:90%"  style="max-width:90%" border="0" id="Image12" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>       <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image13','','images/_03_.gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_03.gif"  class="lazy"   name="Image13"    style="max-width:90%"  style="max-width:90%" border="0" id="Image13" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>       <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image14','','images/_04_.gif',1)"><img  src="/static/imghwm/default1.png"  data-src="images/_04.gif"  class="lazy"   name="Image14"    style="max-width:90%"  style="max-width:90%" border="0" id="Image14" / alt="js菜单下拉,怎么有一个可以正常显示,另一个点击一闪就没啦_html/css_WEB-ITnose" ></a><a href="#"></a>      </span></p>    </div>    </li>       </li>  </ul></div>  </div></div></div></body></html>




回复讨论(解决方案)

蛋糕目录中是正常的,在关于我们里就弹一下就没了显示
你这些在哪。。

我这ie8和火狐都没什么反应

我的资源里有纯css+div的弹出菜单,可供你参考。

会不会跟事件冒泡有关?你去网上查查怎么JS阻止事件冒泡,应该在弹出框显示的代码后面加上阻止事件冒泡,就会好了。
事件冒泡与浏览器有关,具体写法,网上也都找得到的,我从前在工作中也遇到过类似的情况。。希望可以帮助到你。

我佩服你的勇气啊,看到你写的html,好像是直接在dreamweaver里操作的弹出隐藏,太复杂了,且不易维护更新,去学下div+css+jquery,图片的切换现在很多都是用css sprite(把一些琐碎图片放到整张大图片),做成背景的切换,导航弹出同隐藏也比较流行的是jquery实现效果

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
HTML:结构,CSS:样式,JavaScript:行为HTML:结构,CSS:样式,JavaScript:行为Apr 18, 2025 am 12:09 AM

HTML、CSS和JavaScript在Web开发中的作用分别是:1.HTML定义网页结构,2.CSS控制网页样式,3.JavaScript添加动态行为。它们共同构建了现代网站的框架、美观和交互性。

HTML的未来:网络设计的发展和趋势HTML的未来:网络设计的发展和趋势Apr 17, 2025 am 12:12 AM

HTML的未来充满了无限可能。1)新功能和标准将包括更多的语义化标签和WebComponents的普及。2)网页设计趋势将继续向响应式和无障碍设计发展。3)性能优化将通过响应式图片加载和延迟加载技术提升用户体验。

HTML与CSS vs. JavaScript:比较概述HTML与CSS vs. JavaScript:比较概述Apr 16, 2025 am 12:04 AM

HTML、CSS和JavaScript在网页开发中的角色分别是:HTML负责内容结构,CSS负责样式,JavaScript负责动态行为。1.HTML通过标签定义网页结构和内容,确保语义化。2.CSS通过选择器和属性控制网页样式,使其美观易读。3.JavaScript通过脚本控制网页行为,实现动态和交互功能。

HTML:是编程语言还是其他?HTML:是编程语言还是其他?Apr 15, 2025 am 12:13 AM

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增强WebevebDevelopment。

HTML:建立网页的结构HTML:建立网页的结构Apr 14, 2025 am 12:14 AM

HTML是构建网页结构的基石。1.HTML定义内容结构和语义,使用、、等标签。2.提供语义化标记,如、、等,提升SEO效果。3.通过标签实现用户交互,需注意表单验证。4.使用、等高级元素结合JavaScript实现动态效果。5.常见错误包括标签未闭合和属性值未加引号,需使用验证工具。6.优化策略包括减少HTTP请求、压缩HTML、使用语义化标签等。

从文本到网站:HTML的力量从文本到网站:HTML的力量Apr 13, 2025 am 12:07 AM

HTML是一种用于构建网页的语言,通过标签和属性定义网页结构和内容。1)HTML通过标签组织文档结构,如、。2)浏览器解析HTML构建DOM并渲染网页。3)HTML5的新特性如、、增强了多媒体功能。4)常见错误包括标签未闭合和属性值未加引号。5)优化建议包括使用语义化标签和减少文件大小。

了解HTML,CSS和JavaScript:初学者指南了解HTML,CSS和JavaScript:初学者指南Apr 12, 2025 am 12:02 AM

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的角色:构建Web内容HTML的角色:构建Web内容Apr 11, 2025 am 12:12 AM

HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 个月前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
1 个月前By尊渡假赌尊渡假赌尊渡假赌
威尔R.E.P.O.有交叉游戏吗?
1 个月前By尊渡假赌尊渡假赌尊渡假赌

热工具

MinGW - 适用于 Windows 的极简 GNU

MinGW - 适用于 Windows 的极简 GNU

这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

WebStorm Mac版

WebStorm Mac版

好用的JavaScript开发工具

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器