I have made a jsFiddle where i use twitter bootstrap popover function on an icon.
<div style="margin-top:200px">
<ul>
<li class="in-row">
<a href="#" id="meddelanden" data-title="Meddelanden" data-toggle="clickover"
data-placement="right"><i class="icon-globe"></i></a>
</li>
</ul>
</div>
jquery:
var elem = '<div class="well"><a href="google.com">Message one, From someone.</a></div>'+
'<div class="well"><a href="google.com">Message one, From someone.</a></div>'+
'<button id="close-popover" class="btn btn-small btn-primary pull-right">Close please!</button>';
$('#meddelanden').popover({animation:true, content:elem, html:true});
I do not seem to be able to close the popover with the button inside it. I have tried making a jquery click function on the id "close-popover" but noting happens. (I did not include my attempt to close it inside the jsfiddle)
Any suggestions for how you can close a popover with a button inside the popover?
Regards, Bill
Try this:- http://jsfiddle.net/6hkkk/
var elem = '<div class="well"><a href="google.com">Message one, From someone.</a></div>'+
'<div class="well"><a href="google.com">Message one, From someone.</a></div>'+
'<button id="close-popover" data-toggle="clickover" class="btn btn-small btn-primary pull-right" onclick="$("#meddelanden").popover("hide");">Close please!</button>';
$('#meddelanden').popover({animation:true, content:elem, html:true});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With