底部浮动div(如在Facebook消息中) [英] Bottom floating div (like in facebook messages)

查看:146
本文介绍了底部浮动div(如在Facebook消息中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些类型的css(也许jquery)解决方案,其中div将永远停留在屏幕的底部 - 像这是在Facebook上完成 - >查看消息 - >单独的消息交谈。 回复框始终保持在底部,当您滚动到顶部查看以前的邮件时,回复框也会向上移动。

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.

感谢

推荐答案

HTML:

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

CSS:

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

jQuery在加载时滚动到底部:

jQuery to scroll to bottom on load:

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

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

这篇关于底部浮动div(如在Facebook消息中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆