![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an element in the table and not make it a background so that I can use it's position for other script activities, and because the table keeps other elements in relative position. Any recommendations on how I handle this? |
#3
| |||
| |||
|
|
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an element in the table and not make it a background so that I can use it's position for other script activities, and because the table keeps other elements in relative position. Any recommendations on how I handle this? I assume when you say scroll/resize you mean the document is reflowed: |
#4
| |||
| |||
|
|
"Ken Kast" <ken (AT) NOSPAMkenkast (DOT) com> wrote in message news:PNTUa.8790$j%4.386272 (AT) twister (DOT) socal.rr.com... Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an element in the table and not make it a background so that I can use it's position for other script activities, and because the table keeps other elements in relative position. Any recommendations on how I handle this? Absolutely positioned elements are positioned relative to the HTML document |
|
are keeping their position relative to the vewport's upper left corner during scrolling then your animation script must be re-positioning them. In which case it is handling scrolling inappropriately and needs to be corrected. |
|
Correcting for changes in page layout due to window re-sizing means either constantly checking the page offset of the image element and using that as a basis for positioning the positioned elements, or doing the same in response to window.onresize events. Unfortunately, window.onresize is not supported by some of the browsers that would otherwise be happy with the other features of your script as described. In any event, you are unlikely to receive any more useful suggestions unless you provide access to a working example of the script in action. Richard. |
#5
| |||
| |||
|
|
Absolutely positioned elements are positioned relative to the HTML document Absolutely positioned elements are positioned relative to the containing block (aka offsetParent node). so they should scroll with the rest of the document. Absolutely positioned elements do not "scroll with" the rest of the document: they are just absolutely positioned, "nailed" within their respective offsetParent nodes (or containing block, if you wish). |
|
When I first read the OP, I just thought there were no concrete details, no url, no specifics (browser, version, page rendering mode,etc), nothing reliable, no sufficient chunks of relevant code (not even a single line) to be able to say anything. ... snip So until this issue can be accordingly sorted, cleared, there is not a lot that can be said. |
![]() |
| Thread Tools | |
| Display Modes | |
| |