Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use 'manual' as a trigger option for popovers in the Twitter Bootstrap framework?

In the Twitter Bootstrap framework, both the Twipsy and Popover plugins list 'manual' as an option for triggering the tooltip. How would one use the manual option (i.e. what's the practical effect of that - how does the tooltip get activated)?


Answer
This is what I ended up using (making use of 'toggle'):

jQuery(document).ready(function($) {
$('.popup-marker').popover({
        html: true,
        trigger: 'manual',
    }).click(function() {
        $(this).popover('toggle');
    });
});
like image 222
Travis Northcutt Avatar asked Jan 17 '12 16:01

Travis Northcutt


People also ask

How do you activate Popovers?

Popovers can be triggered via JavaScript — just call the popover() Bootstrap method with the id , class or any CSS selector of the required element in your JavaScript code. You can either initialize popovers individually or all in one go.

How do I show popover in bootstrap 5?

To create a popover, add the data-bs-toggle="popover" attribute to an element. Note: Popovers must be initialized with JavaScript to work.


1 Answers

You could activate it with:

$('#element').twipsy('show')

And then hide with:

$('#element').twipsy('hide')
like image 167
bjornd Avatar answered Sep 25 '22 06:09

bjornd