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
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/
Why not using CSS fixed positioning?
#bottomDiv
{
position: fixed;
right: 50px;
}
you can use the css property
div.theItem {
position: fixed;
}
精彩评论