Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

vertically locked div

Options
  • 26-02-2008 6:05pm
    #1
    Closed Accounts Posts: 975 ✭✭✭


    Not quite sure how to phrase this.

    I'm looking for a way to make a div fixed in a vertical position, so it "follows" you when you scroll up or down, a bit like the css directive background-attachment: scroll.

    My googling prowess has failed me on this one, as I'm not sure what to search for.


Comments

  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Pretty sure you're going to need javascript to do this if you mean what I think you do. (like the navigation on this site.)

    Just running out the door now, but I imagine that should help your googling.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Use CSS

    position: fixed

    Should sort it. Apparently it's an issue in IE6 though, which means you may have to add a hack for MS users.


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    CSS... you're looking for position : fixed; ...something like :

    position : fixed;
    left : 10px;
    top : 20px;
    bottom : 20px;
    width : 150px;


  • Closed Accounts Posts: 975 ✭✭✭squibs


    position: fixed was what I was looking for alright. Never had a use for it before, so I forgot it existed. Thanks!

    This gives me further ideas - can the scrolling be constrained to the vertical space available within the containing div? That is to say header/content/footer layout - could a scrolling div in the content area be forced to stop once its top hit the header or its bottom hit the footer?


Advertisement