custom tooltip jQuery plugin(ChillTip)
Designed by Christopher Hill, ChillTip is a JQuery Plugin that allows you to have a custom designed tooltip for your website. It can be used for span, img, anchor attributes and pretty much anything else that uses the title attribute. ChillTip has been tested with IE6, IE7, IE8, Firefox, Google Chrome, Opera and Safari.
Before starting this project I had previously used custom tooltips, whilst using a few I quickly came across problems. Many of them had custom designed attributes that were not recognized by HTML Validators which led to the failure of validation of a webpage.
Others showed the default browser tooltip aswell as the custom one. Some would not allow symbols or characters to be displayed and would stop the page working and others where not customizable.
Therefore I set out to design my own one tooltip and to provide a solution that addressed these problems and to design a tooltip that really works without any limitations.
Step One - Download ChillTip
Downlaod chilltip-packed.js and place it in your javascript directory in this example we are using a directory called 'js'.
Step Two - Download JQuery
ChillTip is a JQuery Plugin, therefore you will require Jquery for it to work. Simply download the latest version from the JQuery Website and save it to the 'js' directory.
Step Three - Add PlugIn & Framework to the head section
Now add the Jquery Framework and chilltip.js to the head section of your web page. Now we should have something like below in our head section:
<head> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/chilltip-packed.js"></script> </head>
Step Four - Add ChillTip to attributes.
Now we can now add ChillTip to our html code. To do this create a img, anchor or span attribute. In this example we are going to use anchor attribute to create a link. Then I we are going to add a class="ChillTip" as we want the Chilltip to be applied to this link. Then add the title="YOUR CONTENT" attribute to give a description of what the link is for.
<head> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/chilltip-packed.js"></script> </head> <body> <a href="chilltip.html" class="ChillTip" title="To learn more about the Chilltip Project click here.">For more info.</a> </body>
Step Five - Adding Colour
In this example we are going to change the colour of the word Chilltip to blue. We need to put the word ChillTip <span class="one"></span>. But for it to work correctly we need to change the < / " > to ascii html codes. For example change < to < , / to / , " to " , > to > like below.
<head> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/chilltip-packed.js"></script> </head> <body> <a href="chilltip.html" class="ChillTip" title="To learn more about the <span class="one">Chilltip</span> Project click here.">For more info.</a> </body>
Step Six - Adding More Colour
ChillTip has been designed to be easily customizable and can use up to 6 colours at one time. Theses colours values can be changed in the chilltip-packed.js file at the top.
To add up to six colours in your ChillTip just add:
For Color One Add <span class="one"> YOUR CONTENT </span>
For Color Two Add <span class="two"> YOUR CONTENT </span>
For Color Three Add <span class="three"> YOUR CONTENT </span>
For Color Four Add <span class="four"> YOUR CONTENT </span>
For Color Five Add <span class="five"> YOUR CONTENT </span>
For Color Six Add <span class="six"> YOUR CONTENT </span>
So if we use all six colours should should have something similar to below:-
<head> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/chilltip-packed.js"></script> </head> <body> <a href="chilltip.html" class="ChillTip" title="<span class="one">Blue</span>, <span class="two">Pink</span>, <span class="three">Green</span>, <span class="four">Purple</span>, <span class="five">Red</span>, <span class="six">Yellow</span>">For more info.</a> </body>
You might also like
Tags
accordion accordion menu animation navigation animation navigation menu carousel checkbox inputs css3 css3 menu css3 navigation date picker dialog drag drop drop down menu drop down navigation menu elastic navigation form form validation gallery glide navigation horizontal navigation menu hover effect image gallery image hover image lightbox image scroller image slideshow multi-level navigation menus rating select dependent select list slide image slider menu stylish form table tabs text effect text scroller tooltips tree menu vertical navigation menu