悬停时保持打开状态的jQuery工具提示 [英] Jquery tooltip that stays open on hover

查看:69
本文介绍了悬停时保持打开状态的jQuery工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下工具提示: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/

I'm working with the following tooltip: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/

这确实很好,但是是否支持实现悬停时保持打开状态的工具提示?还是一种实现方式?

This works really well, but is there any support for implementing a tooltip that stays open on hover? Or a way to implement that?

推荐答案

最后,我选择为粘性"工具提示创建一个单独的jquery插件.

In the end, I opted to create a seperate jquery plugin for a 'sticky' tooltip.

它与通常的工具提示基本相同,只是它不会在鼠标移开时隐藏自己.

Its basically the same as the usual tooltip, except it doesn't hide itself on mouseout.

如果要查看实现,请检查原始jquery工具提示中的'createHelper'方法,并进行如下修改:

If you want to see the implementation, check the 'createHelper' method in the original jquery tooltip and modify it as follows:

helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
            .bind('mouseleave', function () { hide(undefined, settings); })
            // add to document
            .appendTo(document.body)           
        // hide it at first
            .hide();

上面的操作基本上是:创建一个div父对象,并将其保持打开状态,直到用户离开打开的工具提示为止.

The above basically does: create a div parent, and keep it open until the user leaves the open tooltip.

这篇关于悬停时保持打开状态的jQuery工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆