Binding to Bootstrap tooltip
<div>
Lorem ipsum dolor sit amet, <a data-bind="tooltip: { title: 'Tooltip example' }">consectetur</a> adipiscing elit.
Vestibulum nec pharetra eros. Sed luctus vitae ligula
<a data-bind="tooltip: { title: tooltipTitle, placement: tooltipPlacement }">viverra</a> porttitor.
Vestibulum porttitor egestas lacus.
</div>
<!-- ... -->
<input type="text" data-bind="value: title, valueUpdate: 'afterkeydown'" />
<div>
<input type="radio" name="tooltipPlacement" value="left" data-bind="checked: placement" />
Left
<input type="radio" name="tooltipPlacement" value="right" data-bind="checked: placement" />
Right
<input type="radio" name="tooltipPlacement" value="top" data-bind="checked: placement" />
Top
<input type="radio" name="tooltipPlacement" value="bottom" data-bind="checked: placement" />
Bottom
</div>
function TooltipExampleViewModel() {
this.tooltipTitle = ko.observable('Observable title');
this.tooltipPlacement = ko.observable('left');
}
data-bind="tooltip: tooltipOptions"
tooltipOptions
Type: object, can be observable
Uses Bootstrap 3 options. If any option is not specified, uses default value. See Bootstrap documentation. All of the options can be observables. Also option's object can be observable too.