Team:UCL/Template:SCJtooltip.js

From 2014.igem.org

Revision as of 22:05, 9 October 2014 by Sanjaycj (Talk | contribs)
(function($){$.fn.tipr=function(options){var set=$.extend({"speed":200,"mode":"bottom"},options);return this.each(function(){var tipr_cont=".tipr_container_"+set.mode;$(this).hover(function(){var out='
'+$(this).attr("data-tip")+"
";$(this).append(out);var w_t=$(tipr_cont).outerWidth();var w_e=$(this).width();var m_l=w_e/2-w_t/2;$(tipr_cont).css("margin-left",m_l+"px");$(this).removeAttr("title");

$(tipr_cont).fadeIn(set.speed)},function(){$(tipr_cont).remove()})})}})(jQuery);