Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

display bootstrap popovers outside divs with overflow:hidden

Tags:

I've got a question about how to get a bootstrap popover to show above (outside) a slider, which has a wrapper of overflow:hidden, that I can't seem to get around.

I'm using this slider: http://owlgraphic.com/owlcarousel/ I'm also using Twitter bootstrap 2.3.2 popovers: http://getbootstrap.com/2.3.2/javascript.html#popovers

both work well together with the exception of the overflow:hidden on the carousel, which is similar to issues like this: Popovers in Bootstrap 2.2.1 https://github.com/twbs/bootstrap/issues/6122

My question specifically is: Has anyone gotten this to work? I've done some moves with height and negative margin to get the vertical height showing, but if the popover is at the edge of my wrapping dive, it will get cut off at the edge. please let me know if I need to provide any additional detail.

Thanks Steph

like image 750
StephanieF Avatar asked Aug 12 '13 19:08

StephanieF


People also ask

How do I show popover on hover?

Set the trigger option of the popover to hover instead of click, which is the default one. Or with an initialization option: $("#popover"). popover({ trigger: "hover" });

How do I enable popovers in bootstrap?

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.

How do I use popovers in bootstrap 5?

To create a popover, you need to add the data-bs-toggle="popover" attribute to an element. Whereas, popover's title and its content that would display upon trigger or activation can be specified using the title and data-bs-content attribute respectively. Here is the standard markup for adding a popover to a button.


1 Answers

Ok, so I figured this one out.

I changed:

$('.popover-with-html').popover({ html : true, }); 

to:

$('.popover-with-html').popover({ html : true, container: 'body'});  

and it's working.

container: 'body' 

was the key, I hope this helps someone.

Thanks

Steph

like image 148
StephanieF Avatar answered Oct 23 '22 14:10

StephanieF