tags:

views:

36

answers:

1
$(document).ready(function () {
    $('img.menu_class').click(function () {
    $('ul.the_menu').slideToggle('medium');
    });
    $('.img.menu_class').mouseover(function() {
    $('ul.the_menu').slideToggle('medium');
    });
});

I've added this mouseover, but it doesnt work, only if i click.. What have i done wrong?

A: 

You should use mouseenter and mouseleave insted of mouseover because mouseover is triggered every time the pointer moves into the child element and mouseenter only when the pointer moves into the bound element.

$('img.menu_class').bind("mouseenter", function () {
    $('ul.the_menu').slideToggle('medium');
});
$('ul.the_menu').bind("mouseleave", function () {
    $('ul.the_menu').slideToggle('medium');
});
Ed
My menu doesnt work at all with this?
Karem
Your new edited code works the same as Jacob´s, issue: menu slides up when you try to markover a <li> link
Karem
I guess that will work now. It will help if you post your html too
Ed
It works now great.. i tested in FF and IE, but then in IE why do i need to accept "ActiveX controller warning" in order to have it working?
Karem