Permalink
Browse files

Fixed syntax error

  • Loading branch information...
1 parent 5920d4a commit 7e4b448d3115866f47ac686e7a3d660c2ba8da54 Brian Cray committed May 13, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 tooltipsy.min.js
  2. +1 −1 tooltipsy.source.js
View
@@ -13,7 +13,7 @@
(function($){$.tooltipsy=function(el,options){var base=this;base.$el=$(el);base.el=el;base.random=parseInt(Math.random()*10000);base.shown=false;base.width=0;base.height=0;base.$el.data("tooltipsy",base);base.init=function(){base.settings=$.extend({},$.tooltipsy.defaults,options);base.$el.bind('mouseenter',function(e){if(base.shown==false){base.shown=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);if((function(o){var s=0,k;for(k in o){if(o.hasOwnProperty(k)){s++;}}
return s;})(base.settings.css)>0){base.$tip.css(base.settings.css);}
base.width=base.$tipsy.outerWidth();base.height=base.$tipsy.outerHeight();}
-if(base.settings.alignTo=='cursor'){var tip_position=[e.pageX+base.settings.offset[0],e.pageY+base.settings.offset[1]];if(tip_position[0]+base.width>$(window).width())){var tip_css={top:tip_position[1]+'px',right:tip_position[0]+'px',left:'auto'};}
+if(base.settings.alignTo=='cursor'){var tip_position=[e.pageX+base.settings.offset[0],e.pageY+base.settings.offset[1]];if(tip_position[0]+base.width>$(window).width()){var tip_css={top:tip_position[1]+'px',right:tip_position[0]+'px',left:'auto'};}
else{var tip_css={top:tip_position[1]+'px',left:tip_position[0]+'px',right:'auto'};}}
else{var tip_position=[(function(pos){if(base.settings.offset[0]<0){return pos.left-Math.abs(base.settings.offset[0])-base.width;}
else if(base.settings.offset[0]==0){return pos.left-((base.width-base.$el.outerWidth())/2);}
View
@@ -51,7 +51,7 @@
if (base.settings.alignTo == 'cursor') {
var tip_position = [e.pageX + base.settings.offset[0], e.pageY + base.settings.offset[1]];
- if(tip_position[0] + base.width > $(window).width())) {
+ if(tip_position[0] + base.width > $(window).width()) {
var tip_css = {top: tip_position[1] + 'px', right: tip_position[0] + 'px', left: 'auto'};
}
else {

0 comments on commit 7e4b448

Please sign in to comment.