1

I'm looking for some type of css (maybe jquery) solutions where the div would always stay at the bottom of the sreen - like this is done on facebook -> view messages -> individual message conversation. The "Reply" box always stays at the bottom and when you scroll to the top to see previous messages the reply box also moves up.

thanks

ShaneKm
  • 19,771
  • 42
  • 153
  • 271
  • if you want an item to be fixed on the page, give it the css property, position: fixed – Ibu Jul 05 '11 at 07:12
  • Do you have specific browser requirements? If you need IE6 support `position:fixed`, on its own, will not work. – andyb Jul 05 '11 at 07:19

3 Answers3

6

HTML:

    <body>
        <div id="footer"></div>
    </body>

CSS:

#footer {
    position:fixed;
    bottom:0;
    height:100px;
    width:100%;
}

jQuery to scroll to bottom on load:

$(function(){
    $("body").animate({scrollTop: $(this).height()}, 1000); 
});

http://jsfiddle.net/AlienWebguy/CCpJg/5/

AlienWebguy
  • 75,484
  • 17
  • 116
  • 141
  • the problem with this is that when i scroll to the top the "footer" div should be always on TOP of the page content. So the page starts off being "at the bottom", and I should be able to scroll to top. – ShaneKm Jul 05 '11 at 07:55
0

Why not using CSS fixed positioning?

#bottomDiv
{
   position: fixed;
   right: 50px;
}
Saeed Neamati
  • 34,403
  • 40
  • 131
  • 186
0

you can use the css property

div.theItem {
   position: fixed;

}
Ibu
  • 41,298
  • 13
  • 73
  • 100