【问题标题】:Get the Bootstrap popover to stay open until cursor is moved away from it?让 Bootstrap 弹出窗口保持打开状态,直到光标移开?
【发布时间】:2013-11-23 01:05:54
【问题描述】:

我有这个实现,它使用户能够将鼠标悬停在具有 icon-ban-circle 类的元素上,然后看到带有链接的 Bootstrap 弹出窗口:

## 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 类中,以便在用户尝试单击弹出框中的链接时保持打开状态?

【问题讨论】:

    标签: javascript twitter-bootstrap popover


    【解决方案1】:

    使用delay

    延迟显示和隐藏弹出框(毫秒) - 不适用于手动 触发类型

    如果提供了一个数字,延迟将应用于隐藏/显示

    对象结构为:delay: { show: 500, hide: 100 }

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

    【讨论】:

    • 这在我的实现中会变得非常混乱。我更多的是寻找一种解决方案,只要鼠标悬停在弹出框上它就会保持打开状态。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多