JavaScript Fading Tooltips (Only 2KB)
5
Jun
This is a lightweight (2kb) JavaScript tooltip script that is created by Leigeber, a web development blog having nice JavaScript resources.
The tooltip script has a fading animation whose alpha & speed can be set easily.
How to use it?
- Include the script.js in your webpage
- Add the following JavaScript codes to the tag holding the content. For ex:
<span onmouseover="tooltip.show('<strong>Lorem ipsum</strong>');" onmouseout="tooltip.hide();">JavaScript tooltip</span>
Requirements: No Requirements
Compatibility: All Major Browsers
Website: http://www.leigeber.com/2008/06/javascript-tooltip/
Demo: http://sandbox.leigeber.com/tooltip
Compatibility: All Major Browsers
Website: http://www.leigeber.com/2008/06/javascript-tooltip/
Demo: http://sandbox.leigeber.com/tooltip
- Tags:
Javascript
- Filed under: Browsing, Goodies, No License
Related Posts
Popular Posts
- Free Vector World Maps Collection
- Photoshop Heart Brushes Collection
- 64 Beautiful And Free Nature Brush Sets And Vectors - Giant Design Pack
- Photoshop Flower Brushes - 28 Flowers
- Free Admin Template For Web Applications
- Oriental Photoshop Brushes And Vector Images For Mysterious Designs
- 27 Adobe AIR Applications - Handy For Web Designers
- 55 Free Human Brush Sets And Vector Images - Giant Design Pack
- Sliding Top Menu With jQuery
- Test (Sample) Data Generators
















2 Responses for "JavaScript Fading Tooltips (Only 2KB)"
You can also create Rails helper to save your typing a bit (add this to app/helpers/application_helper.rb):
def tooltip(label, text, html_options={})
options = {:class => ‘hotspot’, :onmouseover => “tooltip.show(’#{text}’)”, :onmouseout => “tooltip.hide();”}.merge(html_options)
content_tag(:span, options) do
label
end
end
Then in your views, simply use:
Hope that helps someone
Seems wordpress ate my rails tags, so in your views use
tooltip(”label”, “tooltip text goes here”)
Sorry about that
Valid XHTML | Valid CSS