javascript - Bootstrap 3 弹出框不工作

标签 javascript jquery css wordpress twitter-bootstrap

我一直在寻找有关为什么弹出窗口不起作用的答案。我检查了我的 JS 文件(最新版本)中的弹出窗口代码,它就在那里。 Jquery 用于主页上的导航和轮播。我直接从 Bootstrap 的网站复制并粘贴了按钮的代码。我做错了什么?

去这个页面看问题:http://staging.ceobusinessalliance.com/site-selectors/creative-incentives/它是最顶部的按钮。

谢谢!

最佳答案

您必须首先启用弹出窗口功能,如 Bootstrap 文档中所述:

For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.

你可以通过在你的 html 末尾包含这个小脚本来做到这一点:

$(document).ready(function () { 
    $('[data-toggle="popover"]').popover();
});

Working Example

下次请提供 jsfiddlebootply您的问题,这样我们就不必搜索您的整个网站.. ;)

关于javascript - Bootstrap 3 弹出框不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24332591/

相关文章:

javascript - 光滑的 slider 显示堆叠的幻灯片

javascript - 当用户通过 Tab 键离开网站时将所有音频静音

javascript - jQuery 点击功能——选择器的 css 没有被改变

html - 如果 <tr> 中的 <td> 为空,则填充空白区域

html - CSS - 背景位置 : top 150px not working

javascript - 页面刷新后保留表格排序结果?

javascript - Jquery 平滑滚动使用 Offset.top

javascript - 带有 SensorTag CC2650 的 Web 应用程序

javascript - Twitter Bootstrap 风格 = "width: 45%;"

html - 背景大小的封面/中心不起作用