0

I want to create a tooltip, when user hovers over a link, it shows a tooltip, but does not close on mouseout. It closes only on tooltip area mouseout. In other words, I would be able to hover a link, see a tooltip, navigate to that tooltip with a mouse and do other events inside. Once I mouse out that tooltip (not a link), it closes out. I have a code which shows a tooltip on the link hover, but it hides it as soon as I try to move to that tooltip area. I am using simple live hover method:

 myLink.live('mouseover mouseout', function (e) { 
     ...show balloon...
 }

how do I make it close on tooltip mouse out, but not myLink mouseout? Thanks

3 Answers 3

1

Try this

    myLink.live('mouseover', function (e) { 
         //Code to show the tooltip
         $("toolTipContainerSelector").fadeIn(200);  
    });

$("toolTipContainerSelector").mouseout(function(){
       $(this).hide();
    })

//The below code will take care of hiding the tooltip if you click on the page other than the tooltip. In case you need this please use the below code
    $("body").click(function(){
       if($("toolTipContainerSelector").is(":visible"))
         $("toolTipContainerSelector").hide();
    });

    $("toolTipContainerSelector").click(function(e){
       e.stopPropagation();
    });
Sign up to request clarification or add additional context in comments.

1 Comment

in the fist method, where I display my mouseover effect, is it possible to add .fadeIn() or similar effects? how?
0

Either use an existing jQuery tooltip plugin, or study one of those that you like to see how they handled it. You'll need to deal with event bubbling and keeping track of which areas you want to handle mouseovers and mouseouts in.

1 Comment

I dont wanna use existing ones. I am interested in implementation, not tooltip itself
0

Here is slightly different take on your question along with a fiddle: http://jsfiddle.net/SsAY5/3/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.