меня это выпадающее меню, сделанное с JQuery (EDITED с первым ответом и до сих пор не работает :()Почему мой jQuery выпадающий список скрывается, когда я наводил его?
var currentDrop = null;
var dropTimer;
$(document).ready(function() {
$("ul#menu > li").mouseenter(function(){
if(currentDrop) hideDrops();
currentDrop = $(this).children("ul");
currentDrop.show();
}).mouseleave(function() {
dropTimer = setTimeout("hideDrops()",500);
});
$("ul#menu li ul li").mouseenter(function() {
clearTimeout(dropTimer);
}).mouseleave(function() {
dropTimer = setTimeout("hideDrops()",500);
});
});
function hideDrops(){
if(currentDrop) {
currentDrop.hide();
currentDrop = null;
}
}
список он содержащий сгенерирован с WordPress-сниппета (не проблема я надеюсь !):
<ul id="menu">
<?php wp_list_pages("title_li=&depth=2&exclude=2");?>
</ul>
То, что я не могу понять, почему скрывается суб-уль, когда я парить его, так как currentDrop устанавливается в нуль и, следовательно, не «excisting» и не должны Tricker в прятки функцию. Что делать?
Ошибка можно увидеть в действии на этом временном сайте: gadefodbold.nicolund.dk