The Popover component is a pop-up window that shows up when a user clicks on an element, much as tooltips. The popover can hold a lot more content, which is the difference.
Add the data-toggle=”popover” attribute to an element to create a popover.
To provide the text that should appear inside the popover’s body, use the data-content attribute and the title attribute to specify the popover’s header:
Note: To initialize a popover, select the desired element and invoke the popover() method using jQuery.
To allow all popovers in the document, use the following code:
The popover will by default show up on the element’s right side.
To position the popover at the top, bottom, left, or right of the element, use the data-placement attribute:
Note: If there is insufficient space for the placement attributes, they do not function as you would expect. For instance, it will display the popover below the element or to the right (wherever there is room for it) if you use the top placement at the top of a page (where there is no room for it).
Clicking on the element again closes the popover by default. However, if you click outside of the element, the popover will close if you use the data-trigger=”focus” attribute:
Advice: Use the data-trigger attribute with a value of “hover” if you want the popover to appear when you move the mouse cursor over the element:
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.