Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug in IE6/7
  • Loading branch information
Brian Cray committed May 20, 2011
1 parent 5f58712 commit 7d4304a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tooltipsy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions tooltipsy.source.js
Expand Up @@ -15,7 +15,6 @@
$.tooltipsy = function (el, options) {
this.options = options;
this.$el = $(el);
this.el = el;
this.random = parseInt(Math.random()*10000);
this.ready = false;
this.shown = false;
Expand Down Expand Up @@ -76,7 +75,7 @@
else {
return pos.left + base.$el.outerWidth() + base.settings.offset[0];
}
})(base.$el.offset()),
})(base.offset(base.$el[0])),
(function (pos) {
if (base.settings.offset[1] < 0) {
return pos.top - Math.abs(base.settings.offset[1]) - base.height;
Expand All @@ -87,7 +86,7 @@
else {
return pos.top + base.$el.outerHeight() + base.settings.offset[1];
}
})(base.$el.offset())
})(base.offset(base.$el[0]))
];
}
base.$tipsy.css({top: tip_position[1] + 'px', left: tip_position[0] + 'px'});
Expand Down Expand Up @@ -116,6 +115,17 @@
this.$tip.html(this.settings.content != '' ? this.settings.content : this.title);
};

$.tooltipsy.prototype.offset = function (el) {
var ol = ot = 0;
if (el.offsetParent) {
do {
ol += el.offsetLeft;
ot += el.offsetTop;
} while (el = el.offsetParent);
}
return {left : ol, top : ot};
}

$.tooltipsy.prototype.defaults = {
alignTo: 'element',
offset: [0, -1],
Expand Down

0 comments on commit 7d4304a

Please sign in to comment.