引导酥料饼不是在iPad

引导酥料饼不是在iPad

问题描述:

工作

我有一个引导酥料饼的工作,所以:引导酥料饼不是在iPad

  1. 酥料饼上点击打开当您单击酥料饼外
  2. 酥料饼关闭
  3. 酥料饼具有默认的href因为如果JS被禁用

代码是:

<a class="badge badge-popover" 
    data-original-title="title here" 
    data-trigger="focus" 
    data-placement="right" 
    data-content="<p>Content Here</p>" data-html="true" 
    href="/help">?</a> 

$('.badge-popover').click(function(e){ 
    e.preventDefault(); 
}).popover(); 

它在所有浏览器上工作正常,但在iPad上无法正常工作。任何想法为什么?我哪里错了? 谢谢:)

我使用jQuery 1.9.1,2.1.1引导

+0

你使用的是最新版本的jQuery? – Jivings 2013-03-18 00:10:17

+0

@Jivings我正在使用1.9.1 – 2013-03-18 00:15:12

+0

尝试在点击前链接popover – Ohgodwhy 2013-03-18 00:21:03

尝试使用hover事件:

这应该通过hover并通过手机/平板电脑触发桌面酥料饼(触摸)。

<a class="badge badge-popover" 
    data-original-title="title here" 
    data-placement="right" 
    data-trigger="hover" 
    data-content="<p>Content Here</p>" data-html="true" 
    href="/help">?</a> 
+0

这不适合我。 iPad5,Bootstrap 2.3.2 – 2013-08-10 04:24:57

请参考下面的代码来获得它的工作原理:

$('[data-toggle="popover"]').popover(); 

$('body').on('click', function (e) { 
$('[data-toggle="popover"]').each(function() { 
    //the 'is' for buttons that trigger popups 
    //the 'has' for icons within a button that triggers a popup 
    if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { 
     $(this).popover('hide'); 
    } 
}); 
}); 

这是对身体检测点击的最简单的方法,并关闭网页上的所有提示。

您可以检查活生生的例子here

谢谢!

刚遇到同样的问题。更改data-trigger="focus"data-trigger="click"的作品。悬停也有效。

将data-trigger =“focus”更改为data-trigger =“click”几乎可以正常工作,但问题在于即使单击了外部弹出窗口,弹出窗口仍保持打开状态,只有单击该元素,启动了popover ...