My not flexible hack diff
@@ -178,6 +178,8 @@
if (pos == 'center') { top += height / 2; }
if (pos == 'bottom') { top += height; }
+// alert(tip.y);
+
// horizontal axis
var width = trigger.outerWidth() + tip.outerWidth();
var left = trigger.position().left + trigger.outerWidth();
@@ -186,9 +188,11 @@
if (pos == 'center') { left -= width / 2; }
if (pos == 'left') { left -= width; }
+// alert(tip.x);
+
// offset
top += conf.offset[0];
- left += conf.offset[1];
+ left = tip.x + conf.offset[1];
return {top: top, left: left};
}
@@ -246,7 +250,7 @@
$.extend(self, {
- show: function(e) {
+ show: function(event, e) {
if (e) { trigger = $(e.target); }
@@ -254,6 +258,9 @@
if (tip.is(":animated") || tip.is(":visible")) { return self; }
+ if ( parseInt( event.pageX ) ) { tip.x = event.pageX }
+ if ( parseInt( event.pageY ) ) { tip.y = event.pageY }
+
function show() {
tip.data("trigger", trigger);
@@ -390,9 +397,9 @@
// assign tip's only when apiement is being mouseovered
if (opts.lazy !== false && (opts.lazy === true || this.length > 20)) {
- this.one("mouseover", function() {
+ this.one("mouseover", function(event) {
api = new Tooltip($(this), opts);
- api.show();
+ api.show(event);
});
} else {