I use Twitter Boostrap with website reorganization and I need jQuery help. I use the "Popover" add-in, which is packaged in bootstrap, and I have it in the #div tag (specific #onlineata specification), and I use jquery to reload the div every 10 seconds. This works great, however, if you accidentally hover over a link that activates popover, when the div is updated, popover gets stuck.
I use this code to update:
setInterval(function(){
$("#onlinedata").load("http://website.com #onlinedata");
}, 10000);
And if necessary, the code that activates popover:
$(function () {
$('a[rel=popover]').popover({
placement:'right',
title:'Title',
content: $('#div-that-contains-data').html()
});
});
Is there a way to avoid popover blocking when reloading a div?
Any help is greatly appreciated.
HTML related
$id is the key for every popover, because I have several popovers.
, , popover_controller:
<div id="controller_popup_$id" style="display:none;">
<div style="font-size:11px">
//data_fetched_from_database
</div>
</div>
, popover
<li><a href="#" rel="popover_controller_$id">Link Title</a></li>
, , javascript, ( , javascript):
$(function () {
$('a[rel=popover_controller_$id]').popover({
placement:'right',
title:'Title (this is fetched from the database for each popover)',
content: $('#controller_popup_$id).html()
});
});
$(document).ready(function() {
// refreshing code
setInterval(function() {
$('
$('#onlinedata').load('http://website-link.com #onlinedata', function() {
$('a[rel=popover_controller_$id]').popover({
placement:'right',
title:'Title (this is fetched from the database for each popover)',
content: $('#controller_popup_$id').html()
});
});
}, 10000);
});
** **
, . , , - div #onlineata, popover.
$(document).ready(function() {
$('a[rel=popover_controller_$id]').popover({
placement:'right',
title:'Title',
content: $('#controller_popup_$id').html()
});
setInterval(function() {
$('a[rel=popover_controller_$id]').load('http://websiteurl.com/ #onlinedata', function() {
$('a[rel=popover_controller_$id]').popover('destroy');
$('a[rel=popover_controller_$id]').popover({
placement:'right',
title:'Title',
content: $('#controller_popup_$id').html()
});
});
}, 10000);
});