tags:

views:

87

answers:

1

Hi, I have a Sliding Panel which Open/Close on click. How to to make the panel close after 5 sec Mouseout of the panel ?

P.S. The panel should stop hiding if the user hovers over the panel.

Here is html:

<div id="panel">... content here ...</div>
<a href="#" class="btn-slide">Open/Close</a>

and JS

$("#panel").mouseleave(function(){
       $("#panel").delay(5000).slideUp(250);
    });

    $(".btn-slide").click(function() {
       $("#panel").slideDown(250);    
    });

The .delay(5000) doesn't stops if I in one sec hover on panel *(

A: 

is there anyone who can help me?

Jastin