我在谷歌地图上有问题。我正在使用谷歌地图上方的下拉菜单,鼠标滑过像(交通,教育)这样的项目,使用javascript中的onmouseover事件抛出。但是当鼠标开箱时,这意味着鼠标开箱时盒子变成黑色。我不知道为什么会出现这个问题。
这是问题的图像http://i.imgur.com/CHZOG3G.png?1?2494
这是下拉列表代码
// Copyright 2006-2007 javascript-array.com
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();
// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
if(ddmenuitem) ddmenuitem.style.display = 'none';
// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
ddmenuitem.style.display = '';
ddmenuitem.style.overflowY = 'auto';
ddmenuitem.style.overflowX = 'hidden';
ddmenuitem.style.maxHeight = '250px';
}
// close showed layer
function mclose()
{
if(ddmenuitem){ ddmenuitem.style.visibility = 'hidden';
ddmenuitem.style.overflowY = 'hidden';
}
}
// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
//ddmenuitem.style.zIndex = '1';
window.clearTimeout(closetimer);
closetimer = null;
}
}
// close layer when click-out
document.onclick = setTimeout(mclose,5000);
这是下拉 html 代码中的示例代码
<ul id="sddm" style="padding-left:0px;">
<li><a href="#"
onmouseover="mopen('museumCategory')"
onmouseout="mclosetime()">Museums</a>
<div id="museumCategory" style="z-index:1;"
onmouseover="mcancelclosetime()"
onmouseout="mclosetime()">
<tmpl_var name=museumCategory>
</div>
</li>
.
.
.
.
</ul>