Bootstrap 3 Popover: display on hover AND on click, aka. Pin a Popover
Making a popover appear with the hover trigger works fine.
Making a popover appear with the click trigger works fine.
Now, how do I go about making the popover appear when the triggering image
is hovered over, but then if the user clicks on the image, cancel the
hover and initiate a click toggle? In other words, hovering shows the
popover and clicking 'pins' the popover.
The HTML is pretty standard:
<li>User<span class="glyphicon glyphicon-user" rel="popover"
data-trigger="click" data-container="body" data-placement="auto left"
data-content="Body Text" data-original-title="Title Text"></span></li>
And the popover initialization, even more boring:
$(function () {
$("[rel=popover]").popover();
});
From what I have seen so far, it seems likely that the solution is a nice
complex set of popover('show'), popover('hide'), and popover('toggle')
calls, but my javascript / jQuery-foo is not up to the task.
No comments:
Post a Comment