/* * TipTip * Copyright 2010 Drew Wilson * www.drewwilson.com * code.drewwilson.com/entry/tiptip-jquery-plugin * * Version 1.3 - Updated: Mar. 23, 2010 * * This Plug-In will create a custom tooltip to replace the default * browser tooltip. It is extremely lightweight and very smart in * that it detects the edges of the browser window and will make sure * the tooltip stays within the current window size. As a result the * tooltip will adjust itself to be displayed above, below, to the left * or to the right depending on what is necessary to stay within the * browser window. It is completely customizable as well via CSS. * * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ !function(I){I.fn.tipTip=function(t){var e={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},M=I.extend(e,t);if(I("#tiptip_holder").length<=0){var w=I('
'),O=I(''),x=I('');I("body").append(w.html(O).prepend(x.html('')))}else w=I("#tiptip_holder"),O=I("#tiptip_content"),x=I("#tiptip_arrow");return this.each(function(){function t(){M.enter.call(this),O.html(g),w.hide().removeAttr("class").css("margin","0"),x.removeAttr("style");var t=parseInt(m.offset().top),e=parseInt(m.offset().left),o=parseInt(m.outerWidth()),i=parseInt(m.outerHeight()),n=w.outerWidth(),r=w.outerHeight(),a=Math.round((o-n)/2),f=Math.round((i-r)/2),d=Math.round(e+a),u=Math.round(t+i+M.edgeOffset),p="",l="",h=Math.round(n-12)/2;"bottom"==M.defaultPosition?p="_bottom":"top"==M.defaultPosition?p="_top":"left"==M.defaultPosition?p="_left":"right"==M.defaultPosition&&(p="_right");var c=a+e