The mouseover popups don't work in IE because the function
SimileAjax.DOM.getEventRelativeCoordinates uses evt.offsetX to compute
mouse position, which is relative to a container...which the cost
assumes is always the whole timeplot graph....however once you get
within an event region in IE the event region becomes the container
and offsetX gives a small number which makes the popup go off the
left. Using absolute instead of relative mouse coords in IE seems to
work better.
Workaround is to add this function to dom.js in the ajax API:
SimileAjax.DOM.getEventRelativeCoordinates2 = function(evt, elmt,
delta) {
if (SimileAjax.Platform.browser.isIE) {
var offsetLeft = elmt.parentElement.offsetLeft;
var offsetTop = elmt.parentElement.offsetTop;
return {
x: (evt.clientX-offsetLeft) + document.body.scrollLeft -
delta,
y: (evt.clientY-offsetTop) + document.body.scrollTop
};
} else {
var coords = SimileAjax.DOM.getPageCoordinates(elmt);
return {
x: evt.pageX - coords.left,
y: evt.pageY - coords.top
};
}
};
Then in timeplot plot.js call it like this:
var delta = plot._timeplot._paddingX + 10;
var x = Math.round(SimileAjax.DOM.getEventRelativeCoordinates2
(evt,plot._canvas, delta).x); // replaced call to
getEventRelativeCoordinates
On Apr 8, 3:40 pm, "P.J. Barton" <[email protected]> wrote:
> Hi,
>
> I'm encountering a strange bundle of issues rendering timeplots with event
> overlays that occur only in IE but never in FF.
>
> Within either FF or IE, (with showValues set to true in the
> Timeplot.createPlotInfo() spec). Timeplot works perfectly. I can
> gracefully drag my mouse over a timeplot and see the data in the mouse-over
> pop-up windows.
> So far, so good.
>
> With the addition of an event, including a link property the behavior is
> very different. FF behaves as expected. With the mouse positioned over the
> region covered by the event, the mouse-over pop-ups show up and the cursor
> changes to let me know there's a link.
>
> However in IE, with the mouse over the region covered by the event, the
> mouse-over popups show up at the "beginning of time". In other words, they
> would be in the right place and contain the appropriate data *but only if*
> the event started at the first date of the whole timeplot (it doesn't). And
> the cursor doesn't change to indicate a link.
>
> It's as though the mouse over triggers the right event, using the right
> index, but on the wrong object.
>
> Neither FF nor IE show any browser/js errors.
>
> I'm wondering if anyone else has run into this phenomenon?
>
> Thanks,
>
> - Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---