Jquery Drop down content panel
-
17-06-2021 - |
Вопрос
Could anyone give me some help with this please? The content needs to appear after hovering over a second (I tried using hoverIntent but I couldn't get it to work) and it needs to stay open, only closing/sliding back up when the button is clicked.
Here it is on jfiddle http://jsfiddle.net/VDcL4/4/
Решение
Like this?
$(".btn-slide").on('mouseenter click', function(e) {
switch(e.type) {
case 'mouseenter':
$("#panel").stop().slideDown("slow");
break;
case 'click':
$("#panel").stop().slideUp("slow");
break;
}
return false;
});
Другие советы
All you need to do is replace slideToggle slideDown() -
$(document).ready(function() {
$(".btn-slide").hover(function() {
$('#panel').slideDown(1000);
$(this).addClass("active");
return false;
});
});
Why did you use slideToggle in the first place?
Не связан с StackOverflow