아래 코드는 마우스 오버 또는 버튼을 사용하면 팝업이 닫히지 않도록해야하지만 다시로드 할 때 한 번만 작동하고 작동을 멈추게해야합니다.코드는 한 번만 실행되지만 계속해야합니다.
$('.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);
});
});
데모 : http://jsfiddle.net/MnpWV/1/
질문을 다시 말하십시오. – Ibu
한 번 작동 한 다음 작동을 멈추고 작동을 계속하고 싶습니다. – dezman
@watson이 'clearTimeout'을 제거하면 작동합니다. http://jsfiddle.net/MnpWV/2/ – undefined