Tooltips & Popovers
These tooltips and popovers are adapted from the Twitter Bootstrap JS modules. The stylesheets are based on Twitter Bootstrap, with a couple of ImmobilienScout24 extensions.
Dependencies
Tooltips
Tooltips are simple black boxes that appear to the side of an element when it is hovered.
Markup
Attach a tooltip to an element with the data-toggle="tooltip"
attribute.
Choose the tooltip position with the data-placement
attribute, which can be set to either
top
, right
, bottom
, or left
.
There is a standard icon that you can use for tooltips. Insert it with the tooltip-icon
class.
Initialization
To initialize a tooltip, call the tooltip
method on the respective jQuery elements.
Popovers
Popovers are boxes that will open to a side of an element when the user clicks on or touches the element. They will stay open until the next user interaction outside of the popover.
A popover may optionally have a headline.
Markup
Attach a popover to an element with the data-toggle="popover"
attribute.
Choose the popover position with the data-placement
attribute, which can be set to either
top
, right
, bottom
, or left
.
Initialization
Initialize popovers with the popoverTrigger
method on the jQuery
object. This method will take any jQuery selector as parameter.
It is not strictly necessary for any popover triggers to be present in the DOM at the time that the function is called. A listener on the body element will look for any click events on the given selectors and open/close the respective popovers.