Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap popover is not working in Chrome

http://www.rightoption.co/

You will find "Our Client" On RHS side of page, Click on thumbnails it opens popover(Firefox), But it's not working in Google chrome, Please help me out of this

Edit : Website is no longer on hosting

like image 346
Chandrakant Avatar asked May 14 '12 14:05

Chandrakant


People also ask

How do I enable Popovers?

To create a popover, add the data-toggle="popover" attribute to an element. Note: Popovers must be initialized with jQuery: select the specified element and call the popover() method.

Does bootstrap include Popper?

You must include popper.min.js before bootstrap.js or use bootstrap.bundle.min.js / bootstrap.bundle.js which contains Popper in order for popovers to work! Popovers require the tooltip plugin as a dependency. Popovers are opt-in for performance reasons, so you must initialize them yourself.

How do you use popover in bootstrap react?

We can use the following approach in ReactJS to use the react-bootstrap Popover Component. Popover Props: arrowProps: It is used to position the popover arrow. content: It is used to create a Popover with a Popover.

How do you make a popover in JavaScript?

To create a new popover with JavaScript, you can use the popover() function. To determine which days already have a meeting scheduled, we can add a custom data-booked property. The selector $('[data-booked="true"]') is an attribute selector and will only display a popover for that particular button.


2 Answers

This is because the default trigger for the popover is focus. In Firefox, when you click on something, it seems to gain focus but that does not seem to be true for Chrome in this case.

You can try one of 2 things:

Try to manually set the trigger on the tag to be "manual". So add this attribute data-trigger="manual"

OR

In your document onload, instead of doing:

$('#element, #element1').popover('toggle').popover('hide');

use this line instead:

$('#element, #element1')
   .popover()
   .click(function(e) { 
       e.preventDefault(); 
       $(this).focus(); 
   });
like image 177
Hai Nguyen Avatar answered Sep 23 '22 23:09

Hai Nguyen


The accepted answer is pretty dated now, but it came up for me in a Google search, so I would like to add that as of version 2.3.0 Bootstrap now allows to send 'hover focus' as the trigger so it will work on both. And very importantly, it also allows a 'click' trigger that works as you'd expect (specifically for Chrome).

like image 20
Michael Avatar answered Sep 23 '22 23:09

Michael