I want to use the popover effect on an existing modals dialog using the Bootstrap CSS Library from Twitter. I bind the popover to the small image icon.
$('#infoIcon').popover({
offset: 50,
placement: 'right'
});
The modals itself is also added according the documentation:
$('#modalContainer').modal({
keyboard : true
});
But the effect I've got is, that the popover is rendered UNDER the modal container instead OVER the modal div (see the screenshot below). How can I bring the popover truly OVER the modal div ?
To trigger the modal window, you need to use a button or a link. Then include the two data-* attributes: data-toggle="modal" opens the modal window. data-target="#myModal" points to the id of the modal.
About Modal Popovers Modals provide a nice way to provide extra details without navigating away from the page completely, but they hide your current context and feel a bit 90's. Popovers are essentially stylish tooltips which provide a little extra information without losing context.
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.
The guys at Bootstrap identifies this issue as a bug and fixed it for the next release. see more details here
You don't need javascript for that, simply set the z-index of the popover via CSS:
.popover {
z-index: 1060;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With