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
  • 20,823
  • 43
  • 167
  • 296
  • 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
  • 76,997
  • 17
  • 122
  • 145
  • 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
  • 35,341
  • 41
  • 136
  • 188
0

you can use the css property

div.theItem {
   position: fixed;

}
Ibu
  • 42,752
  • 13
  • 76
  • 103