I tried to achieve the following using Twitter Bootstrap 2.0 and it's popover-plugin, but after a few hours, I still can't figure it out.
Let's just say, on the down-left corner of my page I got a picture showing a bird. This bird should "speak" every popover, for example the ones for a registration form, should appear on top of the bird. Is this possible?
For better understanding I created a test site over here. If you hover over the registration fields, there are the popovers. I want them to appear over the bird-img in the down-left corner, but I don't know how to achieve this. It would be great if you could help me.
Method 1:
The jQuery hover handler takes an "in" and an "out" method, and in your sample you are only assigning the "in" method, to show the popup. This is fine, but rather than attach it to "this", you should attach it to your bird image. Make sure to change the trigger of the popup to manual also. Then in the "out" method of hover, you just need to hide the popover.
$('#registerHere input').hover(function()
{
$('#birdie').popover({
"trigger": 'manual',
"placement":'top',
}).popover('show');
},
function()
{
$('#birdie').popover('hide');
});
Method 2:
Alternately, keep what you have, but use the "selector" option provided, and give it your bird image as a parameter, this should trigger the popover from your control, but delegate it to your bird image.
selector: if a selector is provided, tooltip objects will be delegated to the specified targets
$('#registerHere input').hover(function()
{
$('#birdie').popover({
"selector": "#birdie",
"placement":'top',
}).popover('show');
});
EDIT: Added sample code. I don't have a chance to test this, so there might be some syntax error or something, but the general idea is there.
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