我们如何才能延迟jQuery Beauty Tip? [英] How can we make the delay in jQuery beauty tip?
问题描述
我在将鼠标悬停在Icon上时使用JQuery Beauty Tip.我已将延迟时间设置为1秒,以便用户将鼠标停留在图标上一秒钟以显示美容提示.代码如下.
Hi,
I am using JQuery Beauty Tip on mouse over of an Icon. I have set for 1 sec delay, so that the user should keep the mouse for a second on the icon to display the beauty tip. The code is below.
hoverIntentOpts: {
interval: 1000,
timeout: 2000
}
一切正常.但是,当我们在图标上移动光标但又不停一秒钟时,一秒钟后仍会显示美丽提示.但是,当用户没有在Icon上停留几秒钟时,我不想显示美容提示.我怎样才能做到这一点?有需要设置的属性吗?
请让我知道.
在此先感谢,
This is working fine. But When we move the cursor across the icon but don''t stop for a second on the Icon, the beauty tip is still displaying after a second. But I don''t want to display the beauty tip when a user does not stop the mouse for s second on the Icon. How can I do this? Is there any property to set?
Please let me know.
Thanks in advance,
推荐答案
嗨 请执行以下操作:
Javascript
Hi Please do the following:
Javascript
var tooltipShowDelay = 500;
var tooltipTimer;
function showTooltip()
{
tooltipTimer = setTimeout(function () { displayTooltip(); }, tooltipShowDelay);
}
function displayTooltip(position)
{
var Tooltip = document.getElementById('DivTooltip');
Tooltip.style.display='';
}
HTML
HTML
<div id="DivTooltip" style="display:none">This is Tooltip<div></div></div>
谢谢,
Imdadhusen
Thanks,
Imdadhusen
嗨Imdadhusen,
感谢您的解决方案.我认为这是一种完全不同的方法.实际上,我正在使用Ajaz和JQuery的.bt()函数.
我的情况是:我在页面中使用列表视图,每一行都有一个图标.加载页面时,我正在注册所有图标的美丽提示.因此,当我们将鼠标悬停在特定图标上时,相关数据将显示在美容提示中.代码在下面
AddToolTip:
Hi Imdadhusen,
Thanks for your solution. I think this is a complete different way of doing it. Actually I am using Ajaz and JQuery''s .bt() function.
My scenario is: I am using a list view in my page, each row will have an Icon. While loading the page, I am registering the beauty tips for all the Icons. So when we mouse over on a particular Icon, the related data will be shown in the beauty tip. Code is below
AddToolTip:
function(xx)
{
var parent =
(xx).parents(" ).get( 0 );
(xx).parents("td").get(0);
这篇关于我们如何才能延迟jQuery Beauty Tip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!