Language: JavaScript
Form Tip - jQuery Tooltip plugin experiment :o)
jQuery.fn.formtip = function() { return this.each(function(i, el) { var item = jQuery(el); var title = item.attr("title"); if (title == undefined) { return true; } else { item.hover( function(over) { //alert("over"); var top = item.offset().top; var left = item.offset().left; var width = item.width() + 11; jQuery("body").after("<div class='jformtip-tooltip' style='top: " + top + "px ; left: " + (left + width).toString() + "px ; position: absolute'>" + title + "</div>") }, function(out) { //alert("out"); jQuery(".jformtip-tooltip").remove(); } ); } }); };
Tags:
Description:
my first experimental jquery plugin
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

