This is a migrated thread and some comments may be shown as answers.

Display on hover, else close

1 Answer 121 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 25 Oct 2007, 04:53 PM
Hi, is it possible to display the tooltip when hovering over a link - without it fading away - until I move the mouse away off of the link?

Currently, if I have Sticky="True" then the tooltip displays when i mouseover AND when i mouse out somewhere else. If I then move the cursor back over the link then the tooltip will flash open and then close.

If I set Sticky="False" then when I mouseover the link it will open the tooltip and then close it. If I chane the delay then the delay value works, but if I move the cursor off of the link then the tooltip doesn't disappear until the dealy is finished.

I'm not sure if I am using this correctly or not. Thanks.

<a id="lnkAbstract" href="#"><img src="images/question.gif" /></a>

<telerik:RadToolTip runat="server" ID="rttAbstract" Skin="Web20Green" Width="300px"

TargetControlID="lnkAbstract" IsClientID="true" Animation="Fade" Sticky="true"

RelativeTo="Element" Position="BottomCenter">

</telerik:RadToolTip>

 

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 29 Oct 2007, 04:38 PM
Hello Darren,

We implemented a simple solution for you based on the tooltip events, as well as using the onmouseout event handler of the target element to detect when the mouse leaves it. It is not a general solution but it does provide you with all the necessary bits to implement it in your own scenario:

<script> 
        var toHide = false;       
        function OnBeforeShow(sender, args)  
        {  
            toHide = false;  
        }  
          
        function OnBeforeHide(sender, args)  
        {  
            if (!toHide) args.set_cancel(true);  
        }  
          
        function OnTargetMouseOut()  
        {  
            toHide = true;  
        }  
        </script> 
          
        <href="#" onmouseout="OnTargetMouseOut()" id="link1">I am a link</a> 
        <telerik:RadToolTip runat=server   
        ID="RadTooltip1"   
        TargetControlID="link1" 
        IsClientID="true" 
        Text="I am a tooltip"    
        HideDelay=0       
        OnClientBeforeShow = "OnBeforeShow" 
        OnClientBeforeHide="OnBeforeHide">    
        </telerik:RadToolTip> 
         


Best wishes,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Darren
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or