Twitter Bootstrap Popover - DOM插入位置 [英] Twitter Bootstrap Popover - DOM Insertion Location

查看:140
本文介绍了Twitter Bootstrap Popover - DOM插入位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Bootstrap Popovers工作正常,但popover get附加到文档底部的 body ,而不是触发元素下面,就像在bootstrap文档中一样: http://twitter.github.com/bootstrap/javascript.html#popovers

I have Bootstrap Popovers working fine, but the popover get's appended to body at the bottom of the document, as opposed to just below the triggering element, as it does in the bootstrap documentation: http://twitter.github.com/bootstrap/javascript.html#popovers

任何人都知道如何控制弹出窗口的插入位置?或者至少,让它附加到父母的触发元素?

Anyone know how to control where a popover is inserted? Or at the very least, get it to append to the triggering elements parent?

这就是我所拥有的:

http://jsfiddle.net/qt34N/4/

 <a href="#" class="btn" rel="popover" data-placement="top" 
  data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." 
  data-original-title="Popover on top">Popover on top</a>

jQuery:

$("a[rel=popover]").popover();

建议?

推荐答案

该演示使用的是较新版本的bootstrap。更新到最新版本,它将按您的要求执行。

The demo is using a newer version of bootstrap. Update to the latest and it will perform like you want it to.

http://jsfiddle.net/qt34N/10 /

jQuery(document).ready(function($) {
    $("a[rel=popover]").popover();
});​

这篇关于Twitter Bootstrap Popover - DOM插入位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆