C
ChadW
I am writing a page which displays Arabic and Hebrew (language goes
from right to left) and it is running on IE7.
On mouse events, the X coordinate is the distance from the visible
left side of the window (to the right of the vertical scrollbar) to
the mouse.
If I am to dynamically position elements however, the left style
property (element.style.left) is based off a 0 X coordinate relative
to the horizontal scrollbar being set all the way to the right
(remember, this is a RTL language... in English, the horizontal
scrollbar would normally be set all th way to the left by default). If
I was to scroll horizontally over to the left, the 0 coordinte would
be N pixels (where N > 0) over to the right of the vertical scrollbar
(which appears on the left side of the browser).
To properly calculate position, I need to know how far the user
scrolled horizontally. The problem is, the document.body.scrollLeft
property still works like a LTR language (ie, English). So, when the
page first loads and the horizontal scrollbar appears & lets me scroll
right to left, the scrollLeft property gives me an initial value of N
pixels (where N > 0). Only when I scroll all the way over to the left
side does scrollLeft give me a value of 0.
What I need to figure out is how far over did I scroll. Basically, I
need a scrollRight property.
Any ideas how I can figure this out?
scrollWidth property tells me how wide the page is in total but not
how much I can scroll right to left.
Thanks in advance,
Chad
from right to left) and it is running on IE7.
On mouse events, the X coordinate is the distance from the visible
left side of the window (to the right of the vertical scrollbar) to
the mouse.
If I am to dynamically position elements however, the left style
property (element.style.left) is based off a 0 X coordinate relative
to the horizontal scrollbar being set all the way to the right
(remember, this is a RTL language... in English, the horizontal
scrollbar would normally be set all th way to the left by default). If
I was to scroll horizontally over to the left, the 0 coordinte would
be N pixels (where N > 0) over to the right of the vertical scrollbar
(which appears on the left side of the browser).
To properly calculate position, I need to know how far the user
scrolled horizontally. The problem is, the document.body.scrollLeft
property still works like a LTR language (ie, English). So, when the
page first loads and the horizontal scrollbar appears & lets me scroll
right to left, the scrollLeft property gives me an initial value of N
pixels (where N > 0). Only when I scroll all the way over to the left
side does scrollLeft give me a value of 0.
What I need to figure out is how far over did I scroll. Basically, I
need a scrollRight property.
Any ideas how I can figure this out?
scrollWidth property tells me how wide the page is in total but not
how much I can scroll right to left.
Thanks in advance,
Chad