脚本
// Wait for the page and all the DOM to be fully loaded
$('body').ready(function() {
// Add the 'hover' event listener to our drop down class
$('.dropdown').hover(function() {
// When the event is triggered, grab the current element 'this' and
if ($(this).find('.sub_navigation').is(":visible")) {
// find it's children '.sub_navigation' and display/hide them
$(this).find('.sub_navigation').slideUp();
} else {
$(this).find('.sub_navigation').slideDown();
}
});
});
首先这里是小提琴 //
我正在使用 wordpress 创建我的网站...(如果这很重要)有人帮助我让下拉菜单更好地工作。但是自从我添加了新的 JQuery 脚本后,这个链接就不起作用了。我尝试将鼠标悬停在它上面,但没有掉下菜单。
当我将鼠标悬停在小提琴上时,它可以工作。为什么是这样?我该如何解决这个问题?!:(