子菜单隐藏在谷歌地图后面
submenu is hidden behind google map
在主页(pocetna(上,当你浏览"dizajn"垂直菜单时,效果很好,但当你进入"kontakt"页面时,问题出现了,菜单就在谷歌地图后面,我不知道如何解决它。如果有人知道解决方案,我会很感激。谢谢
javascript的代码是这样的(这段代码是从视频中复制的如何创建垂直菜单,因为我对编码不太了解。谢谢你的理解(
$("document").ready(function() {
// Function triggered when mouse hovers over a menu item
// Looking for a LI item that has a UL for a child element
// If it does trigger the function on mouseover
$('#sidebarmenu li a').parent().has('ul').mouseover(function() {
// offset() returns the top & left relative position on the doc for LI
tagOffset = $(this).offset();
/* I use the following to get the tag name for this
getTagName = $(this).get(0).tagName;
alert(getTagName); */
// Get distance from the left for the LI
offsetLeft = tagOffset.left;
// Get distance from the top for the LI
offsetTop = tagOffset.top;
// Move the new popup 180px to the left (Width of parent UL)
popOutOffsetLeft = offsetLeft + 226;
// Get the id for the first UL contained in the LI
closeParent = $(this).closest("ul").attr("id");
// Checking if the UL is a second level of third level popup menu
if (closeParent == 'sidebarmenu')
{
// Make menu visible and move it into position on the document
$(this).find('ul').first().css({'visibility' : 'visible', 'left' : popOutOffsetLeft + 'px', 'top' : offsetTop + 'px'});
} else {
// Find offset for the UL that surrounds the third level popup
secondOffset = $(this).find('ul').last().parent().offset();
// Subtract the top offset from the second menu to position properly
secondOffsetTop = secondOffset.top - offsetTop;
// Correct the positioning on offset left
secondOffsetLeft = offsetLeft - 10;
// Make menu visible and move it into position on the document
$(this).find('ul').last().css({'visibility' : 'visible', 'left' : secondOffsetLeft + 'px', 'top' : secondOffsetTop + 'px'});
}
});
// When the mouse moves off the menu hide everything
$('#sidebarmenu li a').parent().has('ul').mouseout(function() {
$(this).find('ul').css({'visibility' : 'hidden'});
});
});
查看控制台,您还没有在kontakt页面中包含jquery。
将此插入您的kontakt.php
<script src="js/vendor/jquery-1.10.1.min.js"></script>
未捕获引用错误:未定义$在检查时收到此消息
kontakt.php
中缺少jQuery文件
为映射和菜单容器分配"z-index"css属性,并且菜单的一个必须大于映射的一个,例如100表示菜单,99表示映射。
相关文章:
- 点击打开弹出菜单,在谷歌地图Api中提供详细信息
- 谷歌地图:在下拉菜单中更改地图标记位置
- 谷歌地图:使用菜单设置新的中心点
- 带有复选框的谷歌地图自定义下拉菜单
- 使用jQuery下拉菜单更改谷歌地图图标
- 用菜单个性化谷歌地图
- 粘性菜单被谷歌地图卡住了
- 需要谷歌地图打开Fancybox的多个标记弹出菜单
- 谷歌地图不会出现在模式弹出菜单中
- 子菜单隐藏在谷歌地图后面
- 无法为谷歌地图输入选择下拉菜单选项
- 谷歌地图:放大/缩小与平移到特定点,如maps.google.com上下文菜单
- 如何显示谷歌地图绘制工具时,按下按钮菜单
- 谷歌地图V3上下文菜单
- 下拉菜单在谷歌地图信息窗口
- 引导折叠菜单不显示与谷歌地图
- 融合表谷歌地图第二个Javascript下拉菜单不工作
- 命名下拉菜单-谷歌地图
- 使用JQuery或Javascript选择谷歌地图的下拉菜单
- Onsenui:滑动菜单+谷歌地图