MonkeyBoo
MonkeyBoo

Reputation: 147

JQuery SlideUp/SlideDown works ocassionaly

The dev site is this: https://bcdev01.alpineincdev.com/

If you hover over the cart area (top right), a new div slides down covering the trigger area. When mouse leaves the new div, it's supposed to slide up.

Sometimes this function works. Sometimes it doesn't slide up but stuck in the extended position. Other times, but not always (in Firefox), it goes up and down continuously.

What gives?

The Jquery code is below

 <script>
jQuery.noConflict();

 // Use jQuery via jQuery(...)
 jQuery(document).ready(function(){


    jQuery("#minicart_trigger").hover(
        function () {
          jQuery("#minicart").slideDown("slow");  
        }
      );

    jQuery("#minicart").mouseleave(function() {
        jQuery("#minicart").slideUp("slow");
    });


 });

Any idea of why this happens?

Thanks!

Upvotes: 1

Views: 632

Answers (1)

Jai
Jai

Reputation: 74738

replace with this:

jQuery("#minicart_trigger").hover(function () {
        jQuery("#minicart").stop().slideDown("slow");  
    },function() {
        jQuery("#minicart").stop().slideUp("slow");
});

Upvotes: 1

Related Questions