H I O X INDIA
FREE Javascript
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games





TOOLTIP UTILITY


About
This javascript will help you to build tooltip for a link / button in a webpage as your wish. A "tooltip" is one name given to the small yellow box that appears when you hover over an object on your screen. It works in Internet Explorer, Opera, and Netscape 6.


Features
a)You can build more number of tooltips in the same webpage.
b)You can get the tooltip information using this javascript function.
c)Simple and ease of use.
d)Just download the image, copy the code in to your page and use it.


Download
Version 1.0 - Tooltip-Images.zip
Release Date - 23-12-2007.


Preview
Just move your mouse cursor over the button or image.



LINK


Code
CSS CODE:
<style type = "text/css">
        #bubble_tooltip{
		width:210px;
                position:absolute;
                display: none;
        }
        #bubble_tooltip .bubble_top{
                position:relative;
                background-image: url(htooltip/bubble_top.gif);
                background-repeat:no-repeat;
                height:18px;
                }
        #bubble_tooltip .bubble_middle{
                position:relative;
                background-image: url(htooltip/bubble_middle.gif);
                background-repeat: repeat-y;
                background-position: bottom left;
        }
        #bubble_tooltip .bubble_middle div{
		padding-left: 12px;
                padding-right: 20px;
                position:relative;
                font-size: 11px;
                font-family: arial, verdana, san-serif;
                text-decoration: none;
                color: red;	
		text-align:justify;	
        }
        #bubble_tooltip .bubble_bottom{
                background-image: url(htooltip/bubble_bottom.gif);
                background-repeat:no-repeat;
                height:65px;
                position:relative;
                top: 0px;
        }
</style>
    
<!-- Script by hscripts.com -->


HTML Code:
<!-- Script by hscripts.com -->
<table id="bubble_tooltip" border=0 cellpadding=0 cellspacing=0> <tr class="bubble_top"><td></td></tr> <tr class="bubble_middle"><td><div id="bubble_tooltip_content"></div></td></tr> <tr class="bubble_bottom"><td colspan=5></td></tr> </table> Just move your mouse cursor over the button or image.<br><br> <input type="button" id="b1" value="BUTTON" onmouseover="showToolTip(event,text1)" onmouseout="hideToolTip()"></input> <br><br> <a href="#" onmouseover="showToolTip(event,text2)" onmouseout="hideToolTip()"> LINK </a> <!-- Script by hscripts.com -->


Javascript Code:
<script language=javascript>

            var text1="The tooltip is an easy way of interaction for the visitors in a web page ";

            var text2="For webhosting, please contact us at support@hiox.com";                    

//This is the text to be displayed on the tooltip.

if(document.images){
  pic1= new Image(); 

  pic1.src='htooltip/bubble_top.gif'; 

  pic2= new Image();
 
  pic2.src='htooltip/bubble_middle.gif'; 

  pic3= new Image(); 

  pic3.src='htooltip/bubble_bottom.gif'; 
}

function showToolTip(e,text){
                if(document.all)e = event;
                
                var obj = document.getElementById('bubble_tooltip');

                var obj2 = document.getElementById('bubble_tooltip_content');
		
		obj2.innerHTML = text;
		
                obj.style.display = 'block';

                var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);

                if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 

                var leftPos = e.clientX-2;

                if(leftPos<0)leftPos = 0;

                obj.style.left = leftPos + 'px';

                obj.style.top = e.clientY-obj.offsetHeight+2+st+ 'px';
        }       
        
        function hideToolTip()
        {
                document.getElementById('bubble_tooltip').style.display = 'none';
        }

</script>
<!-- Script by hscripts.com -->


Get free version without ©copyright link for just 5



Usage
How to use tooltip?

1) Unzip the download.

2) You will get the images used in this javascript and if you want to use this images
   then include the following line,
        pic1.src='htooltip/bubble_top.gif';
        pic2.src='htooltip/bubble_middle.gif';
        pic3.src='htooltip/bubble_bottom.gif';


3)If you want to change the message then add your Message in Javascript code
    var text1 = "Your tooltip Message";
    var text2 = "Your tooltip Message";
    You can add as many messages as your wish.

4)Html content

    <input type="button" id="b1" value="Button" onmouseover="showToolTip(event,text1)" onmouseout="hideToolTip()">
    <a href="#" onmouseover="showToolTip(event,text2)" onmouseout="hideToolTip()">LINK</a>


Your message is passed as argument for the javascript function showtooltip(event,text1)

5)When the mouse is pointed over the button or link, the function showtooltip(event,text) is triggered and the tooltip is displayed.

6)When the mouse is taken out,the function hidetooltip() is triggered and hides the tooltips.

7)Copy the code into your page and use the script.




License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Others