Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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.
JavaScript
hoverIntentOpts: {
    interval: 1000,
    timeout: 2000
  }

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,
Posted
Updated 1-Apr-11 0:30am
v2

Hi Please do the following:
Javascript
C#
var tooltipShowDelay = 500;
var tooltipTimer;
function showTooltip() 
{
    tooltipTimer = setTimeout(function () { displayTooltip(); }, tooltipShowDelay);
}

function displayTooltip(position) 
{
   var Tooltip = document.getElementById('DivTooltip');
   Tooltip.style.display='';
}

HTML
XML
<div id="DivTooltip" style="display:none">This is Tooltip<div></div></div>



Thanks,
Imdadhusen
 
Share this answer
 
Comments
Sandeep Mewara 1-Apr-11 6:30am    
My 5!
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:
Java
function(xx)
{
  var parent = $(xx).parents("td").get(0);

  $(parent).bt({
   contentSelector: '$(\'#' + Icon.id + '\')',
    trigger: ..
    .....
    ....
    clickAnywhereToClose: true,
    closeWhenOthersOpen: true,
    .......
    .......
    hoverIntentOpts: {
      interval: 1000,
      timeout: 2000
    }
  });

The AddToolTip function will be called for all the rows of a list view while loading the page. But when we mouse over of a particular Icon, the tooltip will show with related data. Now here I want to handle the delay of 1 second on mouse over.

Sorry I couldn't apply your solution in this scenario. Please let me know with more details.

Thanks in Advance.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900