Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  99] [ 3]  / answers: 1 / hits: 44073  / 11 Years ago, fri, january 17, 2014, 12:00:00

When I use the bootstrap popover in 'manual' mode 'destroy' and 'hide' not working properly.
When I'm using hide and destroy, popover opacity changing to 0 but its not changing display to none, which resulting that the popover container cover the content bellow it.
Otherwise if I use 'toogle' mode it's working properly.



My code:



$('[rel=popover]').popover({
html: true,
placement: 'auto',
container: 'body',
trigger: 'manual'
});

$('body').on('click' , '[rel=popover]' , function(e){
e.stopPropagation();
$(this).popover('toggle');
});

$('body').on('click' , '.popoverClose' , function(e){
e.stopPropagation();
var i = $(this);
$('.inputInfo').filter('[data-info-id=' +i.data('info-id')+ ']').popover('hide');
});

// new code
$('body').on('click', function(){
$('[rel=popover]').popover('hide');
});

More From » jquery

 Answers
20

My temporary solution look like this:



I'm using:



$('.popover').remove();


to remove popovers



and



$('body').on('click' , '[rel=popover]' , function(e){
e.stopPropagation();

var i = $(this);
var thisPopover = $('.popoverClose').filter('[data-info-id=' +i.data('info-id')+ ']').closest('.popover');
if( thisPopover.is(':visible') ){
$('.popover').remove();
}
else{
$(this).popover('show');
}
});


to toggle popovers


[#73099] Thursday, January 16, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kalaveronicab

Total Points: 3
Total Questions: 100
Total Answers: 105

Location: Guam
Member since Fri, Jun 18, 2021
3 Years ago
;