How to show bootstrap popover one at a time?

First you call the popover plugin with the selector

$('[data-toggle="popover"]').popover(options);
You must be set the "trigger" option to "manual" for showing one popover at a time.

$('[data-toggle="popover"]').popover({'trigger': 'manual'});
Then you should catch the click event. Show the current popover and hide others

$('[data-toggle="popover"]').on('click', function (e)
{
    $(this).popover('show');
    $('[data-toggle="popover"]').not(this).popover('hide');
});
The final code & demo is here


Demo

No comments:

Post a Comment