0

I'm using this tooltip plugin:

I'm trying to get the clientX of the tooltip area. Meaning, the X position where the client hovered over the element. So far, no luck.

Here's an example:

$(this).find("div.GanttRange[data-RangeID != '']").tooltip({
    bodyHandler: function (e) {
        if (!_self.DragInProgress) {
            result = window[_self.ElementRangeTooltipFunction](_self.GetRelativeClientX(e.clientX));
        } else {
            result = "";
        }
        return result;
    },
    opacity: 0,
    track: true,
    showURL: false
});

e is undefined in this context. How do I find it otherwise?

jbkkd
  • 1,510
  • 5
  • 18
  • 37

1 Answers1

1

Thanks to the answer in this question I've solved this issue by modifying the Tooltip plugin code.

In the tooltip anonymous function, replace this:

.mouseover(save)

with this:

.mouseover(function(evt){save.call(this, evt)})

In the Save function, replace this:

function save() {

with this:

function save(evt) {

and this:

var bodyContent = settings(this).bodyHandler.call(this);

with this:

var bodyContent = settings(this).bodyHandler.call(this, evt.clientX);
Community
  • 1
  • 1
jbkkd
  • 1,510
  • 5
  • 18
  • 37