I did find similar questions but it didn't help me in my case.
Basically i show an info popover when i click on an anchor. I realize this with the following js code
$("[data-popover]").click(function(){
var selector = $(this).data('popover');
var popoverContentId = $(this).data('popover-content');
var popoverPlacement = $(this).data('placement');
var popoverWidth = $(this).data('width');
var htmlContent = $(popoverContentId).html();
$(selector).popover({placement: popoverPlacement, title: '', width: popoverWidth, content: htmlContent, html: true});
});
Now with this code, the first click nothing happens, but afterwards it works just fine with a single click.
How to show the popover from the first click ?
Thanks.
$(selector).popover
only enables the popover. It doesn't need to be in a click event.
I would change the .click
to say .each