1

    I'm having trouble with a hover. If you quickly move your mouse in and out of an area it fires the .show() but not the .hide(). I'm not sure if it works in other browsers but it's not in Chrome.

    You can see a sample at the link below. I've tried the all the true false variations with .stop() but it's not working. I appreciate your help and I'm sure I'm just doing something silly.

http://jsfiddle.net/glenn2223/xBgVe/2/

.stop().show('slide', {direction: 'up'}, "fast", false);

Many thanks for your help,
    glenn2223

4
  • 3
    working fine on chrome 35.0.1916.153 m and firefox 31.0
    – Amit Soni
    Jul 7, 2014 at 13:25
  • Do a hard refresh (ctrl + f5) and see if it's working.
    – StaticVoid
    Jul 7, 2014 at 13:27
  • 2
    It easy to recreate the bug, just have to mouse over quick and the event does not fire. Jul 7, 2014 at 13:30
  • Nope, hard refresh still gives no joy
    – glenn223
    Jul 7, 2014 at 13:36

1 Answer 1

0

I'm not quite sure why, but while show() and hide() don't work, slideToggle does. This seems to solve your problem (although I had to remove height: auto !important from your css because it was overriding jQuery's height).

http://jsfiddle.net/prankol57/YBsYh/

Javascript:

jQuery(function () {
    $("ol.top-nav li").hover(function () {
        $(this).children('div.subl').stop().slideToggle("fast");
    });
});

I believe this is because show() and hide() do not cause an animation queue.

1
  • That solves my problem. Thanks a bunch. I saw what you meant by the height auto css, messes up the slide doesn't it. This reduces my code as well, always a bonus. A MASSIVE TICK!! for you
    – glenn223
    Jul 7, 2014 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.