Permalink
Browse files

Hovered element accessible through .data('rootel')

  • Loading branch information...
1 parent c89ee03 commit b448e53d3fb787de9f296cc46a94bd74e6cdfe3c Brian Cray committed May 16, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −1 tooltipsy.min.js
  2. +3 −1 tooltipsy.source.js
View
2 tooltipsy.min.js
@@ -24,4 +24,4 @@ else if(base.settings.offset[1]==0){return pos.top-((base.height-base.$el.outerH
else{return pos.top+base.$el.outerHeight()+base.settings.offset[1];}})(base.$el.offset())];}
base.$tipsy.css({top:tip_position[1]+'px',left:tip_position[0]+'px'});base.settings.show(e,base.$tipsy.stop(true,true));}).bind('mouseleave',function(e){if(e.relatedTarget==base.$tip[0]){base.$tip.bind('mouseleave',function(e){if(e.relatedTarget==base.$el[0]){return;}
base.settings.hide(e,base.$tipsy.stop(true,true));});return;}
-base.settings.hide(e,base.$tipsy.stop(true,true));});};base.readify=function(){base.ready=true;base.title=base.$el.attr('title')||'';base.$el.attr('title','');base.$tipsy=$('<div id="tooltipsy'+base.random+'">').appendTo('body').css({position:'absolute',zIndex:'999'}).hide();base.$tip=$('<div class="'+base.settings.className+'">').appendTo(base.$tipsy).html(base.settings.content!=''?base.settings.content:base.title);};base.init();};$.tooltipsy.defaults={alignTo:'element',offset:[0,-1],content:'',show:function(e,$el){$el.css('opacity','1').show(100);},hide:function(e,$el){$el.fadeOut(100);},css:{},className:'tooltipsy'};$.fn.tooltipsy=function(options){return this.each(function(){new $.tooltipsy(this,options);});};})(jQuery);
+base.settings.hide(e,base.$tipsy.stop(true,true));});};base.readify=function(){base.ready=true;base.title=base.$el.attr('title')||'';base.$el.attr('title','');base.$tipsy=$('<div id="tooltipsy'+base.random+'">').appendTo('body').css({position:'absolute',zIndex:'999'}).hide();base.$tip=$('<div class="'+base.settings.className+'">').appendTo(base.$tipsy);base.$tip.data('rootel',base.$el);base.$tip.html(base.settings.content!=''?base.settings.content:base.title);};base.init();};$.tooltipsy.defaults={alignTo:'element',offset:[0,-1],content:'',show:function(e,$el){$el.css('opacity','1').show(100);},hide:function(e,$el){$el.fadeOut(100);},css:{},className:'tooltipsy'};$.fn.tooltipsy=function(options){return this.each(function(){new $.tooltipsy(this,options);});};})(jQuery);
View
4 tooltipsy.source.js
@@ -108,7 +108,9 @@
base.title = base.$el.attr('title') || '';
base.$el.attr('title', '');
base.$tipsy = $('<div id="tooltipsy' + base.random + '">').appendTo('body').css({position: 'absolute', zIndex: '999'}).hide();
- base.$tip = $('<div class="' + base.settings.className + '">').appendTo(base.$tipsy).html(base.settings.content != '' ? base.settings.content : base.title);
+ base.$tip = $('<div class="' + base.settings.className + '">').appendTo(base.$tipsy);
+ base.$tip.data('rootel', base.$el);
+ base.$tip.html(base.settings.content != '' ? base.settings.content : base.title);
};
base.init();

0 comments on commit b448e53

Please sign in to comment.