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

Change offsetY via Javascript?

3 Answers 107 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
radBrad
Top achievements
Rank 1
radBrad asked on 21 Apr 2008, 06:58 PM
How can I change the offsetY in the OnClientShow or the OnClientBeforeShow Javascript Event?

3 Answers, 1 is accepted

Sort by
0
radBrad
Top achievements
Rank 1
answered on 21 Apr 2008, 09:36 PM
Another thing could help....

is there a way to get the client ID of the TargetControlID in the OnClientShow or the OnClientBeforeShow Javascript Event?

0
radBrad
Top achievements
Rank 1
answered on 22 Apr 2008, 02:14 AM
nevermind, I figured out both of these.
sender.get_offsetY(int) 
sender.set_offsetY(int)


and

var targetControll = $get(sender.get_targetControlID());

However, I still can't figure out how to change the style.top of the sender?
The following doesn't seem to work.
        var tooltip = $get(sender.get_id());     
         tooltip.style.position = 'absolute';
         tooltip.style.top = '100px';        
         tooltip.style.left = 0;



Please help, the tooltip isn't displaying in the correct position in dotnetnuke if there is any scroll. I can fix the scroll offset, but i have to be able to set the top position of the tooltip.
0
Ubong
Telerik team
answered on 24 Apr 2008, 08:24 AM

Hello Brad,

There are two possible solutions for this:
  1. On the Server, you set 

      rdtltip.RelativeTo = Telerik.Web.UI.ToolTipRelativeDisplay.BrowserWindow;  
            rdtltip.Position= Telerik.Web.UI.ToolTipPosition.TopLeft; 

    and then on the client you set :

    sender.set_offsetX(200);   
     
     
     
    sender.set_offsetY(200);  
     
     
     

     

     

  2.  For the the other solution entirely ClientSide, you set the following :

      function Show1(sender,args)  
      {  
          sender.set_relativeTo(2);  
          sender.set_position(11);  
          sender.set_offsetX(200);     
          sender.set_offsetY(200);  
      }  
       


    Kind regards,
    Ubong
    the Telerik team


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