jQuery 线索提示激活

标签 jquery cluetip

如何激活cluetip事件准备好还是加载?

The clueTip plugin allows you to easily show a fancy tooltip when the user's mouse hovers over (or, optionally, clicks on) any element you designate in your script. If the element includes a title attribute, its text becomes the heading of the clueTip.

最佳答案

默认情况下,将鼠标悬停在应用了工具提示的元素上时会显示工具提示(请参阅 default options )
这可以更改为 click 事件,我将演示这两个事件。

这个想法是以编程方式触发事件 mouseenter (没有真正的 hover 事件,而是 mouseentermouseleave)。

您可以使用 .trigger('mouseenter').mouseenter()

假设您想打开链接上的工具提示:

<a href="#" id="mylink" title="This is the title|The first the content.|In this case, the delimiter is a pipe">My link</a>

您将拥有以下 JavaScript:

$(document).ready(function() {

    var $link = $('#mylink');

    // first initialize the plugin
    $link.cluetip({
        splitTitle: '|'
    });

    // trigger the event
    $link.mouseenter(); // or $link.click(); 

});

这是一个jsfiddle供你玩。

hover 的文档, .mouseenter() , .click().trigger()

关于jQuery 线索提示激活,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8560518/

相关文章:

javascript - 添加带有生成表函数调用的按钮

javascript - jQuery - 将事件处理程序附加到预先存在的点击事件

Jquery Cluetip - 在工具提示中使用 javascript

javascript - Fabric .js |检查鼠标是否按下错误

javascript - setInterval() 中的函数立即执行

javascript - JQuery: Cluetip questions - 关闭提示和最大高度

javascript - 页面加载后更改线索提示内容

javascript - 使用合成鼠标事件驱动 Javascript 代码

Javascript 检查 url 是否存在并检查其上显示的一些信息