I have a DIV object that I can move around within a browser frame. The position to "absolute", and the onmousemove event behavior then changes the x and y coordinates of the DIV. I pick up the DIV with an onmousedown event, and drop the DIV with an onmouseup event.
My problem is that when I move the DIV to the edge of the frame, it doesn't automatically scroll (I want this only when scrollbars are enabled, of course).
I've tried to force scrolling in Javascript by checking the window.frameElement.scrollLeft and window.frameElement.scrollTop properties, then using the window.scrollBy method. The scrollLeft and scrollTop properties, however, always return 0 even when the scrollbars are enabled.
Ideally, no extra Javascript would be required, if the DIV were styled correctly. Any ideas?
My problem is that when I move the DIV to the edge of the frame, it doesn't automatically scroll (I want this only when scrollbars are enabled, of course).
I've tried to force scrolling in Javascript by checking the window.frameElement.scrollLeft and window.frameElement.scrollTop properties, then using the window.scrollBy method. The scrollLeft and scrollTop properties, however, always return 0 even when the scrollbars are enabled.
Ideally, no extra Javascript would be required, if the DIV were styled correctly. Any ideas?