如何解决菜单悬停问题
我在一个网站上工作,但其菜单遇到了问题。当我将鼠标悬停在菜单上时,其子菜单不会出现。所以请帮我解决这个问题。
http://www.mulberrydesignerkitchens.com/
我一直使用一段代码来实现 jQuery 菜单,
var $jnav = jQuery.noConflict();
$jnav(document).ready(function () {
$jnav('#menu-mainnav li').hover(
function () {
$jnav(this).css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-current-bg.png') no-repeat", 'cursor', "pointer");
if ($jnav(this).is('#menu-mainnav li:last-child')) {
$jnav('#menu-mainnav li:last-child').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-last-bg.png') no-repeat");
} else if ($jnav(this).is('.sub-menu li:last-child')) {
$jnav('.sub-menu li:last-child').css('background', "none scroll #8e4d69");
}
}, function () {
if (!$jnav(this).hasClass('current-menu-item')) {
$jnav(this).css('background', "none");
}
if (!$jnav('#menu-mainnav li:first').hasClass('current-menu-item')) {
$jnav('#menu-mainnav li:first').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-first-bg.png') no-repeat");
}
})
$jnav('#menu-mainnav li ul li').hover(
function () {
$jnav(this).css('background-color', "#8e4d69", 'cursor', "pointer");
}, function () {
if (!$jnav(this).hasClass('current-menu-item')) {
$jnav(this).css('background', "#833b5d");
}
})
if (!$jnav('.superfish li:first').hasClass('current-menu-item')) $jnav('.superfish li:first').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-first-bg.png') no-repeat");
$jnav('.superfish li.current-menu-item:last-child').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-last-bg.png') no-repeat");
if (!$jnav('.sub-menu li:first').hasClass('current-menu-item')) $jnav('.sub-menu li:first').css('background', "#833b5d");
$jnav('.sub-menu li.current-menu-item:last-child').css('background', "#833b5d");
$jnav('ul.superfish').superfish();
});
我必须单击导航才能看到它的子菜单。请帮我解决这个问题。
谢谢。
i work on a website and having trouble with its menu. when i hover over the menu, its sub-menu doesnot appear. so please kindly help me to sort out this issue.
http://www.mulberrydesignerkitchens.com/
i m using a piece of code to implement jQuery menu
var $jnav = jQuery.noConflict();
$jnav(document).ready(function () {
$jnav('#menu-mainnav li').hover(
function () {
$jnav(this).css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-current-bg.png') no-repeat", 'cursor', "pointer");
if ($jnav(this).is('#menu-mainnav li:last-child')) {
$jnav('#menu-mainnav li:last-child').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-last-bg.png') no-repeat");
} else if ($jnav(this).is('.sub-menu li:last-child')) {
$jnav('.sub-menu li:last-child').css('background', "none scroll #8e4d69");
}
}, function () {
if (!$jnav(this).hasClass('current-menu-item')) {
$jnav(this).css('background', "none");
}
if (!$jnav('#menu-mainnav li:first').hasClass('current-menu-item')) {
$jnav('#menu-mainnav li:first').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-first-bg.png') no-repeat");
}
})
$jnav('#menu-mainnav li ul li').hover(
function () {
$jnav(this).css('background-color', "#8e4d69", 'cursor', "pointer");
}, function () {
if (!$jnav(this).hasClass('current-menu-item')) {
$jnav(this).css('background', "#833b5d");
}
})
if (!$jnav('.superfish li:first').hasClass('current-menu-item')) $jnav('.superfish li:first').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-first-bg.png') no-repeat");
$jnav('.superfish li.current-menu-item:last-child').css('background', "url('http://www.mulberrydesignerkitchens.com/wp-content/themes/MBK/images/nav-last-bg.png') no-repeat");
if (!$jnav('.sub-menu li:first').hasClass('current-menu-item')) $jnav('.sub-menu li:first').css('background', "#833b5d");
$jnav('.sub-menu li.current-menu-item:last-child').css('background', "#833b5d");
$jnav('ul.superfish').superfish();
});
all the time i have to click over the navigation to see it sub-menu. plz plz plz help me to solve this issue.
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有两个菜单脚本相互争夺菜单的悬停事件(Suckerfish 和 jNav),删除其中之一,您的菜单应该得到修复。
要让吸盘鱼发挥作用,您需要做的是:
You have two menu scripts fighting each other for the hover event of your menu (Suckerfish and jNav), remove one of them and your menu should be fixed.
For suckerfish to work all you need is: