View Full Version : Question about placing static elements

10-18-2005, 04:52 PM
Okay, I know how to staticly place elements on a page (ie get it to scroll down the left or right side and such) however, I am curious. If the page in question requires a certain amount of space between the general content and the static content but the window is too narrow to achieve that space, is there a way to place a static element off to the side. For instance, if the page is optimized for a window width of 1024 but the visitor is has a window width of 800, can the element be placed beyond that 800 pixel boundry or is it strictly governed by the width of the window?

10-18-2005, 05:32 PM
elements may have even negative X Y position (or X Y positions > client's width/height) , thus they can be placed anywhere.

10-19-2005, 06:19 AM
So then basicly if I wanted something to ride down the right side of the page beyond the edge of the window, all I would have to do is get the window width and then add X amount to the "left" position of the element and that would push it beyond the right edge of the window if I am reading this correctly, right? And would look something like this perhaps?

//determine window width
var window_width=document.all? document.body.clientWidth : window.innerWidth
//position element 135 pixels beyond right edge of window
if (document.all||document.getElementById){static_element.style.left=parseInt(window_width)+135

Now that I am thinking about it, is there any way to determine the width of the actual document rather than the window without using a table, div or span element to force the document to a certain dimension? As I said before, I am looking to position the static element in relation to the rest of the document contents rather than in relation to the size of the window. The problem seems to arise when I start considering different sized windows and how they effect the display of non-static content. If it can't be done, it is all cool, it was just an idea I had to add a little pizzaz to the page I am working on at the moment.