Similar question already asked but not for this example.
Here we have the code for the popover:
HTML:
<a href="#" class="popover_test">Popover Example</a>
<!-- POPOVER -->
<div id="content" class="hidden">
Contents
</div>
<div id="title" class="hidden">
Title
</div>
Javascript:
$(".popover_test").popover({
html : true,
content: function() {
return $("#content").html();
},
title: function() {
return $("#title").html();
}
});
What is the approch in order to disappear it when i click outside of the popover ?
Here a JSFIDDLE to test it online: https://jsfiddle.net/C5GBU/1772/
$(".popover_test").popover({
html : true,
content: function() {
return $("#content").html();
},
title: function() {
return $("#title").html();
}
});
.hidden {
display: none;
}
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet"/>
<a href="#" class="popover_test">Popover Example</a>
<!-- POPOVER -->
<div id="content" class="hidden">
Contents
</div>
<div id="title" class="hidden">
Title
</div>
Thank's.