473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

tooltip ajax...following your mouse

exoskeleton
104 100+
hi guys..hope you can help me...my boss want me to edit our website and apply the tooltip thing, i mean the moving tooltip that follows the mouse..

please help...thank you... :(
Apr 20 '07 #1
7 3579
Hi

Go to the link and extract what all you want:

http://www.hotscripts.com/Detailed/60399.html

In this page you will see a link called script, which is an example of ajax tooltip.

Regards
TeenzoneZ
Apr 20 '07 #2
acoder
16,027 Expert Mod 8TB
Why do you need to use Ajax for tooltips? Are you gathering data from the server?
Apr 20 '07 #3
exoskeleton
104 100+
Why do you need to use Ajax for tooltips? Are you gathering data from the server?
sir acoder, no im not! i know you already viewed site which tooltip is ajax and i dont know how to do that. Its a requirement in our project here in the company. we offer groupware and we want to enhance and make it more user-friendly and presentable...

im just trying to ask to our dear experts here like you... :)
Apr 23 '07 #4
acoder
16,027 Expert Mod 8TB
Try something like overlib.
Apr 27 '07 #5
exoskeleton
104 100+
hi guys..please help... i have download ajax tooltip ... the tooltip always position under the word it is is being attached. even if the word is at the bottom of the screen it is still display at the bottom...i can see it. i found site that if the word is found at the bottom ... the tooltip appears above to make it visible to viewers.

scripts here attached:

Expand|Select|Wrap|Line Numbers
  1. /* Custom variables */
  2.  
  3. /* Offset position of tooltip */
  4. /* var x_offset_tooltip = 5; */
  5. var x_offset_tooltip = 5;
  6. var y_offset_tooltip = 0;
  7.  
  8. /* Don't change anything below here */
  9.  
  10.  
  11. var ajax_tooltipObj = false;
  12. var ajax_tooltipObj_iframe = false;
  13.  
  14. var ajax_tooltip_MSIE = false;
  15. if(navigator.userAgent.indexOf('MSIE')>=0)ajax_tooltip_MSIE=true;
  16.  
  17.  
  18. function ajax_showTooltip(externalFile,inputObj)
  19. {
  20.     if(!ajax_tooltipObj)    /* Tooltip div not created yet ? */
  21.     {
  22.         ajax_tooltipObj = document.createElement('DIV');
  23.         ajax_tooltipObj.style.position = 'absolute';
  24.         ajax_tooltipObj.id = 'ajax_tooltipObj';        
  25.         document.body.appendChild(ajax_tooltipObj);
  26.  
  27.  
  28.         var leftDiv = document.createElement('DIV');    /* Create arrow div */
  29.         leftDiv.className='ajax_tooltip_arrow';
  30.         leftDiv.id = 'ajax_tooltip_arrow';
  31.         ajax_tooltipObj.appendChild(leftDiv);
  32.  
  33.         var contentDiv = document.createElement('DIV'); /* Create tooltip content div */
  34.         contentDiv.className = 'ajax_tooltip_content';
  35.         ajax_tooltipObj.appendChild(contentDiv);
  36.         contentDiv.id = 'ajax_tooltip_content';
  37.  
  38.         if(ajax_tooltip_MSIE){    /* Create iframe object for MSIE in order to make the tooltip cover select boxes */
  39.             ajax_tooltipObj_iframe = document.createElement('<IFRAME frameborder="0">');
  40.             ajax_tooltipObj_iframe.style.position = 'absolute';
  41.             ajax_tooltipObj_iframe.border='0';
  42.             ajax_tooltipObj_iframe.frameborder=0;
  43.             ajax_tooltipObj_iframe.style.backgroundColor='#FFF';
  44.             ajax_tooltipObj_iframe.src = 'about:blank';
  45.             contentDiv.appendChild(ajax_tooltipObj_iframe);
  46.             ajax_tooltipObj_iframe.style.left = '0px';
  47.             ajax_tooltipObj_iframe.style.top = '0px';
  48.         }
  49.  
  50.  
  51.     }
  52.     // Find position of tooltip
  53.     ajax_tooltipObj.style.display='block';
  54.     ajax_loadContent('ajax_tooltip_content',externalFile);
  55.     if(ajax_tooltip_MSIE){
  56.         ajax_tooltipObj_iframe.style.width = ajax_tooltipObj.clientWidth + 'px';
  57.         ajax_tooltipObj_iframe.style.height = ajax_tooltipObj.clientHeight + 'px';
  58.     }
  59.  
  60.     ajax_positionTooltip(inputObj);
  61. }
  62.  
  63. function ajax_positionTooltip(inputObj)
  64. {
  65.     var leftPos = (ajaxTooltip_getLeftPos(inputObj) + inputObj.offsetWidth);
  66.     var topPos = ajaxTooltip_getTopPos(inputObj);
  67.  
  68.     // exo test
  69.     var rightedge=ajax_tooltip_MSIE? document.body.clientWidth-leftPos : window.innerWidth-leftPos
  70.     var bottomedge=ajax_tooltip_MSIE? document.body.clientHeight-topPos : window.innerHeight-topPos
  71.  
  72.     var tooltipWidth = document.getElementById('ajax_tooltip_content').offsetWidth +  document.getElementById('ajax_tooltip_arrow').offsetWidth; 
  73.  
  74.     // exo test
  75.     //Dropping this reposition for now because of flickering
  76.     var offset = tooltipWidth - rightedge; 
  77.     if(offset>0)leftPos = Math.max(0,leftPos - offset - 5);
  78.  
  79.     ajax_tooltipObj.style.left = leftPos + 'px';
  80.     ajax_tooltipObj.style.top = topPos + 'px';
  81.  
  82. }
  83.  
  84.  
  85. function ajax_hideTooltip()
  86. {
  87.     ajax_tooltipObj.style.display='none';
  88. }
  89.  
  90. function ajaxTooltip_getTopPos(inputObj)
  91. {        
  92.   var returnValue = inputObj.offsetTop;
  93.   while((inputObj = inputObj.offsetParent) != null){
  94.       if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
  95.   }
  96.   return returnValue;
  97. }
  98.  
  99. function ajaxTooltip_getLeftPos(inputObj)
  100. {
  101.   var returnValue = inputObj.offsetLeft;
  102.   while((inputObj = inputObj.offsetParent) != null){
  103.       if(inputObj.tagName!='HTML')returnValue += inputObj.offsetLeft;
  104.   }
  105.   return returnValue;
  106. }
can you please point out where and how should i edit this to automatically sense that the word is at the bottom and display the tooltip above and vice versa..like if the word is at the rightmost part then it should display on the leftside to make it visible.

TIA please help me
May 7 '07 #6
acoder
16,027 Expert Mod 8TB
See this link for the screen properties. Also see this page for finding the position of elements.
May 7 '07 #7
exoskeleton
104 100+
im sorry dear mod, i cant figure it out. :( i dont understand. hope someone might help me to edit the javascript attached above.
May 8 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sakharam Phapale | last post by:
Hi All, I have developed my own user control and created custom mouse enter event. I need to show ToolTip on mouse enter event. I have written following code for that, but it doesn't show ToolTip....
3
by: Dennis | last post by:
I have implemented the ToolTip class for a user control that inheirits from the panel. I show different tool tips depending on where the mouse is on the control when the hover event occurs. ...
5
by: Nikolay Petrov | last post by:
I have a ListBox, which is binded to a DataTable. I would like to display a tooltip when the mouse cursor hovers over the items in the ListBox. I don't know how to find the index if ListBox item,...
5
by: Pavan | last post by:
My goal is to accomplish the tooltip functionality for all the neodes in a tree view and i have the following three Events in my C# application. Name of my TreeView Control (AITreeView) 1)...
4
by: rn5a | last post by:
A DataList displays 3 columns - Product, Category & Price. These columns are populated with records from a SQL Server 2005 DB table. Apart from the above 3 DB columns that the resultset retrieves,...
5
by: =?Utf-8?B?cGV0ZTE5Njk=?= | last post by:
I use Visual Studio 2005 and created a very simple Form with one button. I added a Tooltip for that button. It shows fine the first time I hover over that button. But if I let it disappear by the...
0
by: walve_wei | last post by:
<1>use the D3D control panel, enable the debug DLL and maximum validation,for D3D control panel ,you need to install the directx sdk. <2>Start up the debug monitor (<MSVC install...
3
omerbutt
by: omerbutt | last post by:
hi there i have downloaded a prototype tooltip from http://www.nickstakenburg.com/projects/prototip/ the logic it uses is to call the script after creating the <div> for example i am using the...
5
omerbutt
by: omerbutt | last post by:
hi there i have a link in my pge and on mouseover i want to show the tooltip by getting the coordinates x and y from the screen where the onmouseover event occoured can any one teell me the way to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.