获取Bootstrap popover以保持打开状态,直到光标移开它为止?

时间:2013-11-11 09:24:54

标签: javascript twitter-bootstrap popover

我有这个实现,允许用户将鼠标悬停在具有icon-ban-circle类的元素上,然后看到带有链接的Bootstrap popover:

## some_file.html.haml

%i.icon-ban-circle{:rel => 'popover', "data-content" => "<a href="http://www.google.com">Click here</a>".html_safe}

## some_file.js

var showError;

showError = $(".icon-ban-circle").popover({
  html: true,
  trigger: 'hover'
});

但是一旦用户将光标移动到弹出窗口,它就会消失。如何在icon-ban-circle类中包含popover,以便在用户尝试单击popover中的链接时保持打开状态?

1 个答案:

答案 0 :(得分:0)

使用delay

  

延迟显示和隐藏弹出窗口(ms) - 不适用于手动   触发类型

     

如果提供了数字,延迟将同时应用于hide / show

     

对象结构是:延迟:{show:500,hide:100}

来自http://getbootstrap.com/javascript/#popovers