在页面上的doExit写成doExit(event)
function doExit(e){
e = e||event
var elm=e.relatedTarget||e.toElement;
eExit=event.toElement;
if (eMenu==null || eExit==null) return;
if (!eMenu.contains(eExit) && !eItem.contains(eExit)) noMenu();
}function doOver(){
if ("A"==event.srcElement.tagName.toUpperCase()) {
eItem=event.srcElement.parentElement;
eDesk=eItem.parentElement;
eMenu=document.all[eItem.id.replace('item','menu')];
if (eMenu && eMenu!=null) {eMenu.onmouseout=doExit;doMenu();}
else noMenu();}
}
写成
function doOver(e){ //页面上doOver(event)
e = event|| e
var obj = e.srcElement||e.target
if ("A"==obj.tagName.toUpperCase()) {
eItem=obj.parentElement;
eDesk=eItem.parentElement;
eMenu=document.all[eItem.id.replace('item','menu')];
if (eMenu && eMenu!=null) {eMenu.onmouseout=doExit;doMenu();}
else noMenu();}
}
无完整例子无法调试
解决方案 »
- JS获取和赋值给iframe
- ***怎样获取鼠标在网页上移动的位置(x,y),然后让div的bottom等于鼠标的x,y.
- xsl经过jdom解析后生成的页面正常的,但是html页面对应的源代码中静态中文全部为类似字段这样的字符
- 如何根据css名给dt加入事件处理
- COOKIE如何写进内存,以及如何把它读出来?跪求高手!60分侍侯!不够再加!
- 一..个..很..难..的..问..题.. 如何获得选定控件的基本信息
- 100分求一个翻页效果,急急急
- 呵呵,帮我看看这不是基于对象的表单测试?
- 在ASP+vbscript/javascript中,如何实现数据表格的图表化,就像股票的走势图,或者直方图等等,请赐教!!
- 百度地图web开发,如何让移动用户打开页面,提示“要使用您当前的位置”?
- 急!!!!如何在邮件正文中显示注册商标的符号®
- 请教一个格式限制问题
倒数第三行使用document.all在FF中是不支持的,LZ看下最好是使用别有方式来获取控件
css的属性值可能需要指定单位
document.all最好用document.getElementById/getElementsByTagName/getElementsByName等标准的方法来代替parentElement看起来比较陌生,通常是写parentNode/childNodes的..
<DIV class=menu id=menu11 >
<A href="page/AboutUs/CompanyInfo.html" >Company Info</A><BR>
...
...
</DIV>
<DIV class=menu id=menu12 >
<A href="page/ITConsultingForE-business.html" >IT Consulting For E-business</A>
...
...
</DIV>
<DIV class=menu id=menu14>
<A href="page/Industries/Overview.html">Overview</A><BR>
...
...
</DIV>
<DIV class=menu id=menu16 style="border:1px solid #e0dede; margin-left:20px;" align="left" >
<A href="page/Success story/success stories.html" >IT Consulting For E-business</A><BR>
...
</DIV>
<DIV class=desk id=desk1 onmouseover=doOver() onmouseout=doExit()>
<SPAN id=item11>
<A href="http://www.experexchange.com" onclick="return false;">About Us</A>︱
</SPAN>
<SPAN id=item12>
<A href="http://www.experexchange.com" onclick="return false;">Service</A>︱
</SPAN>
<SPAN id=item14>
<A href="http://www.experexchange.com" onclick="return false;">Industries</A>︱
</SPAN>
<SPAN id=item15>
<A href="page/WhyExperExchange/WhyExperExchange.html">Why ExperExchange</A>︱
</SPAN>
<SPAN id=item16>
<A href="http://www.experexchange.com" onclick="return false;">Success Stories</A>
</DIV>
<!-- -------------------------------------------------------------------------------------- -->
switch (i) {
case 1 : window.external.AddFavorite('http://www.experexchange.com',document.title);break;
case 2 : window.external.AddChannel('http://www.experexchange.com');break;
default : event.srcElement.style.behavior='url(#default#homepage)';event.srcElement.setHomePage('http://www.experexchange.com');break;}
return false;
}function doSel(){
var o=event.srcElement;
if ('select'!=o.tagName.toLowerCase()) return;
var s=o.options[o.selectedIndex].value;
o.selectedIndex=0;
if (s!='1') self.location=s;
}function doWin(l,a,b){
w=window.open(l,'dhtmlet','toolbar=0');
var winx=Math.ceil((window.screen.width-a)/2);
var winy=Math.ceil((window.screen.height-b)/2);
w.resizeTo(a,b);
w.moveTo(winx,winy);
w.focus();想了想还是把整个文件贴出来吧,方便大家调试。这个在ie里面是没问题的<!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=utf-8" />
<title>ExperExchange: Software Solution Provider | Why ExperExchange </title>
<script type="text/javascript" src="menu.js"></script>
</head><body text="#000000" link="#0000FF" vlink="#800080" ><!--topmargin="0" leftmargin="0"-->
<style type="text/css">
ul{list-style-image:none}
</style>
<center><!-- -------------------------------------------------------------------------------------- -->
<DIV class=menu id=menu11 style="border:1px solid #e0dede;" align="left">
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/aboutus/companyinfo.html" style="font-size:9px;"><b><font color="3b53a0">Company Info</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/aboutus/managementteam.html" style="font-size:9px;"><b><font color="3b53a0">Management Team</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/aboutus/methodology.html" style="font-size:9px;"><b><font color="3b53a0">Methodology</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/aboutus/careers.html" style="font-size:9px;"><b><font color="3b53a0">Gareers</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/aboutus/news.html" style="font-size:9px;"><b><font color="3b53a0">News</font></b></A><BR>
</DIV>
<DIV class=menu id=menu12 style="border:1px solid #e0dede; margin-left:20px;" align="left">
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/itconsultingfore-business.html" style="font-size:9px;"><b><font color="3b53a0">IT Consulting For E-business</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/offshoredevelopmentcenter.html" style="font-size:9px;"><b><font color="3b53a0">Offshore Development Center</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/itserviceforstartupcompany.html" style="font-size:9px;"><b><font color="3b53a0">IT Service For Startup Company</font></b></A><BR>
</DIV>
<DIV class=menu id=menu14 style="border:1px solid #e0dede; margin-left:20px;" align="left">
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/overview.html" style="font-size:9px;"><b><font color="3b53a0">Overview</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/financialservice&banking.html" style="font-size:9px;"><font color="3b53a0"><b>Financial Service & Banking</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/manufacturing.html" style="font-size:9px;"><b><font color="3b53a0">Manufacturing</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/government.html" style="font-size:9px;"><b><font color="3b53a0">Government</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/retail&distributiont.html" style="font-size:9px;"><b><font color="3b53a0">Retail & Distribution</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/education.html" style="font-size:9px;"><font color="3b53a0"><b>Education</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/telecommunications.html" style="font-size:9px;"><b><font color="3b53a0">Telecommunications</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/industries/professionalservice.html" style="font-size:9px;"><b><font color="3b53a0">Professional Service</font></b></A><BR>
</DIV>
<DIV class=menu id=menu16 style="border:1px solid #e0dede; margin-left:20px;" align="left" >
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/success%20story/success%20stories.html" style="font-size:9px;"><b><font color="3b53a0">IT Consulting For E-business</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/success%20story/success%20stories.html" style="font-size:9px;"><b><font color="3b53a0">Offshore Development Center</font></b></A><BR>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/success%20story/success%20stories.html" style="font-size:9px;"><b><font color="3b53a0">IT Service For Startup Company</font></b></A><BR>
</DIV>
<DIV class=desk id=desk1 onmouseover=doOver() onmouseout=doExit() align="center" noWrap bgcolor="#ffffff" >
<SPAN id=item11>
<A href="http://www.experexchange.com" onclick="return false;" style="padding-right:20px; font-weight:bold;">About Us</A>︱
</SPAN>
<SPAN id=item12>
<A href="http://www.experexchange.com" onclick="return false;" style="padding-right:20px;padding-left:20px; font-weight:bold;">Service</A>︱
</SPAN>
<SPAN id=item14>
<A href="http://www.experexchange.com" onclick="return false;" style="padding-right:20px;padding-left:20px; font-weight:bold;">Industries</A>︱
</SPAN>
<SPAN id=item15>
<A href="file:///d|/dailydocument/20090423/experexchange/experexchange/page/whyexperexchange/whyexperexchange.html" style="padding-right:20px;padding-left:20px; font-weight:bold;">Why ExperExchange</A>︱
</SPAN>
<SPAN id=item16>
<A href="http://www.experexchange.com" onclick="return false;" style="padding-right:20px;padding-left:20px; font-weight:bold;">Success Stories</A>
</SPAN>
<SPAN id=item>
<img src="file:///D|/DailyDocument/20090423/ExperExchange/ExperExchange/image/Experexchange/index/white.jpg" />
</SPAN>
</DIV>
<!-- -------------------------------------------------------------------------------------- -->
</center>
</body>
</html>