I have a page that looks like this
-----------------------------------
| ************* |
| ************* |
| ************* |
| ************* |
| ************* |
| ************* |
-----------------------------------
The outer frame is the browser edge and thus the <body>
, and the stars are a centred background image on the <body>
element.
Now, using javascript I'd like to add some aboslutely positioned DIVs each side of that background in order to extend it:
-----------------------------------
|*********|*************|*********|
|*********|*************|*********|
|*********|*************|*********|
|*********|*************|*********|
|*********|*************|*********|
|*********|*************|*********|
-----------------------------------
As the window is resized the centred background will move (to remain in the center of the window), so the divs on each side should move in consequence.
Can anyone please suggest an approach to solving this issue?
Side note on why I'm doing this:
The background is large image, and I wish to have it repeated across the screen by flipping it as described here:
Background flipped tiling using Javascript
The actual process of flipping was discussed in that question, whereas this question deals with the CSS/Javascript aspect of positioning.
Note that in the case of non-capable browsers I'm happy leave the page as it is in the first diagram, with only the centred background.