Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Absolute Mouse Position
MarkW
I have a table that has many rows where the vertical scrollbar is visible. In each row, there is a chart and the chart has interactivity setup to call a javascript function openTrend(). In this function, javascript is evaluated to open a div that contains iframe to another birt report that displays another more detailed chart.
This div becomes visible and is shown on the screen where the mouse is clicked. The only problem is that the mouse position is not absolute and when the user scrolls the main scrollbar, the div is shown at the top.
When dealing with many web pages, I have used javascript to get the absolute position using following lines.
But for some reason, this is not working in my BIRT viewer. It returns 0. I have been placing all my javascript in a Text component on the main report page. Is there a better way to place javascript within the report where I might get a better handle on the window of document DOM?
scrolledX = document.body.scrollLeft;
scrolledY = document.body.scrollTop;
or
scrolledX = window.pageXOffset
scrolledY = window.pageYOffset
Find more posts tagged with
Comments
MarkW
Nevermind, furthur investigation I discovered in the DocumentFragment.jsp, that everything is in a DIV. So I simply added the pageY to the DIV.scrollTop.