当鼠标悬停在提示上方时,如何防止 jquery.qtip2 工具提示隐藏?

发布于 2024-12-02 04:50:07 字数 220 浏览 2 评论 0 原文

使用 jquery qTip2 作为工具提示。

我有一个带有链接的工具提示。如果用户的鼠标进入提示(而不是触发器),我希望提示保持打开状态。似乎无法在文档中弄清楚如何做到这一点......

Using jquery qTip2 for tooltips.

I have a tooltip with a link in it. I want the tip to stay open if the user's mouse enters the tip (not the trigger). Can't seem to figure out how to do that in the documentation....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

比忠 2024-12-09 04:50:07

如果您希望当您将鼠标悬停在提示上并进入提示时它保持可见,但仍希望它在鼠标移开时关闭,请使用固定和延迟选项 在此处的文档中进行了描述

$('.selector').qtip({
     content: {
          text: 'I hide on mouseout, but you can mouse into me within 500ms',
     },
     hide: {
          fixed: true,
          delay: 500
     }
});

hide 参数有很多选项。例如,如果您只是不想无限期地隐藏它,只需将 hide 设置为 false:

$('.selector').qtip({
    content: {
        text: 'I never hide',
    },
    hide: false
});

如果您希望它在不同的事件上隐藏,例如单击提示之外的任意位置,请显式设置该事件:

$('.selector').qtip({
     content: {
          text: 'I hide when you click anywhere else on the document',
     },
     hide: {
          event: 'unfocus'
     }
});

如果您希望它在以下情况下隐藏 :单击触发器,指定单击事件:

$('.selector').qtip({
     content: {
          text: 'I hide when you click the tooltip trigger',
     },
     hide: {
          event: 'click'
     }
});

具体请参阅“隐藏”选项文档以获取更多信息。

If you want it to remain visible when you mouse over and into the tip, but still want it to dismiss on mouseout, use the fixed and delay options as described in the documentation here:

$('.selector').qtip({
     content: {
          text: 'I hide on mouseout, but you can mouse into me within 500ms',
     },
     hide: {
          fixed: true,
          delay: 500
     }
});

The hide parameter has many options. For example, if you just want to not hide it indefinitely, simply set hide to false:

$('.selector').qtip({
    content: {
        text: 'I never hide',
    },
    hide: false
});

If you want it to hide on a different event, such as clicking anywhere outside the tip, set the event explicitly:

$('.selector').qtip({
     content: {
          text: 'I hide when you click anywhere else on the document',
     },
     hide: {
          event: 'unfocus'
     }
});

If you want it to hide when the trigger is clicked, specify the click event:

$('.selector').qtip({
     content: {
          text: 'I hide when you click the tooltip trigger',
     },
     hide: {
          event: 'click'
     }
});

See specifically the "hide" options documentation for more info.

再浓的妆也掩不了殇 2024-12-09 04:50:07

如果您希望提示保持打开状态,然后在用户单击目标外部或离开目标时将其隐藏:

show: {
    event: 'mouseover'
},

hide: {
     event: 'click mouseleave'
}

If you want the tip to stay open and then hide it when the user clicks outside the target or leaves the target:

show: {
    event: 'mouseover'
},

hide: {
     event: 'click mouseleave'
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文