Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2004
    Location
    near the only active volcano in the continental US
    Posts
    409
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Question Question about placing static elements

    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?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    elements may have even negative X Y position (or X Y positions > client's width/height) , thus they can be placed anywhere.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Nov 2004
    Location
    near the only active volcano in the continental US
    Posts
    409
    Thanks
    6
    Thanked 2 Times in 2 Posts
    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?

    Code:
    //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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •