Reputation: 19388
The code below should prevent the popup from closing if you mouseover it, or the button, however, it only works once on reload and then stops working.
$('.popover3-test').popover({
placement:'bottom',
template: $('.popover2'),
trigger: 'manual',
}).mouseenter(function(e) {
$(this).popover('show');
var t = null;
$(".popover2, .popover3-test")
.mouseleave(function() {
t = setTimeout(function() {
$('.popover2').hide();
}, 1000); // Or however many milliseconds
})
.mouseenter(function() {
if(t !== null)
clearTimeout(t);
});
});
Demo: http://jsfiddle.net/MnpWV/1/
Upvotes: 0
Views: 90
Reputation: 144729
try this:
$(".popover2, .popover3-test")
.mouseleave(function() {
$('.popover2').delay(1000).fadeOut('1000');
}
});
update:
$(".popover2").hover(function(e) {
$(this).show()
}, function() {
$('this').delay(1000).fadeOut('1000');
})
remove the .popover3-test
which triggers the mouseleave
event.
Upvotes: 1