admin 管理员组文章数量: 1086019
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.
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.
Share Improve this question edited Jun 23, 2012 at 17:21 Andrew Marshall 97k20 gold badges227 silver badges217 bronze badges asked Jun 23, 2012 at 17:19 DominikDominik 2,9062 gold badges36 silver badges47 bronze badges1 Answer
Reset to default 7Method 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.
本文标签: javascriptTwitter Bootstrap show all popovers at one divStack Overflow
版权声明:本文标题:javascript - Twitter Bootstrap, show all popovers at one div - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744067808a2527929.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论