In the bootstrap popover documentation (http://getbootstrap.com/javascript/#popovers) they show on the page the the popover looks like in a static way (before the example where it's connected to the buttons).
I would like to show a popover on my page as an explanation to something on my site - but would like it to always show, without the user having to click anything.
how can I show a static popover like they do? couldn't find an option.
Thanks
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.
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.
If you inspect the HTML that Bootstrap use in their examples they've simply removed the fade
class from the HTML element and then overriden a few of the default styles.
HTML
<div class="popover-example"> <!-- NEW -->
<div class="popover top">
<div class="arrow"></div>
<h3 class="popover-title">Popover top</h3>
<div class="popover-content">
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
</div>
</div>
</div>
CSS
.popover-example .popover {
position: relative;
display: block;
margin: 20px;
}
DEMO
Try this:
$('your_selector').popover('show');
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