html:

<div id="chat_content" class="chat_content">
                    <div class="middle_head">
                        <div class="blue_img"></div>
                        <span>查看更多消息</span>
                    </div>
                    <div class="store_products">
                        <img src="img/2015.jpg" />
                        <div>
                            <p>商品编号:</p>
                            <p>商品名称:乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air)</p>
                        </div>
                    </div>
                    <div class="person1">
                        <p>测试小店客服</p>
                        <img src="img/04.png" />
                        <div class="chat_box">
                            <div class="chat1">
                                乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗? 乐视TV什么时候发货,重庆提供安装服务吗?
                            </div>
                        </div>
                    </div>
                    <div class="person2">
                        <p>戴尔官方直营店</p>
                        <img src="img/03.png" />
                        <div class="chat_box2">
                            <div class="chat2">
                                乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air) 乐视TV什么时候发货,重庆提供安装服务吗?乐视TV什么时候发货,重庆提供安装服务吗? 乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air) 乐视TV什么时候发货,重庆提供安装服务吗?乐视TV什么时候发货,重庆提供安装服务吗? 乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air) 乐视TV什么时候发货,重庆提供安装服务吗?乐视TV什么时候发货,重庆提供安装服务吗?
                            </div>
                        </div>
                    </div>
                    
                    <div class="person1">
                        <p>测</p>
                        <img src="img/04.png" />
                        <div class="chat_box">
                            <div class="chat1">乐?</div>
                        </div>
                    </div>
                    <div class="person1">
                        <p>测试小店客服dgbawvrbhrwaet</p>
                        <img src="img/04.png" />
                        <div class="chat_box">
                            <div class="chat1">乐视TV什么时候发货,重庆提供安装服务吗?</div>
                        </div>
                    </div>
                    <div class="person2">
                        <p>戴尔官方直营店</p>
                        <img src="img/03.png" />
                        <div class="chat_box2">
                            <div class="chat2">
                                乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air) 乐视TV什么时候发货,重庆提供安装服务吗?乐视TV什么时候发货,重庆提供安装服务吗?
                            </div>
                        </div>
                    </div>
                    <div class="person2">
                        <p>戴尔官方直营店</p>
                        <img src="img/03.png" />
                        <div class="chat_box2">
                            <div class="chat2">
                                吗?</div>
                        </div>
                    </div>
                    <div class="person2">
                        <p>戴店</p>
                        <img src="img/03.png" />
                        <div class="chat_box2">
                            <div class="chat2">
                                乐?</div>
                        </div>
                    </div>
                    <div class="chat_time">
                        <p class="center gray">2017-02-03 17:50:20</p>
                        <p class="center gray">上次聊到这里</p>
                        <p class="center currentmsg">您好,<span class="current">测试小店</span> 客服很高兴为您服务!</p>
                        <p class="center gray">09:36</p>
                    </div>
                    <div class="person3">
                        <p>戴尔官方直营店</p>
                        <div class="chat_box3">
                            <img src="img/2017.jpg" />
                            <div>
                                乐视超级电视S50 Air 全配版 50英寸2D智能LED黑色(Letv S50 Air)
                                <span class="red">10.00</span>
                            </div>
                        </div>
                    </div>
                </div>

CSS:

  .chat_content {
      overflow-x: hidden;
      position: relative;
      height: 363px;
  }

JS:

  $(document).ready(function(){
          $('.chat_content').scrollTop($('.chat_content')[0].scrollHeight);
     })

js控制滚动条默认在底部的更多相关文章

  1. js控制滚动条在最底部位置

    window.scrollTo(0, document.body.scrollHeight) 如果需要始终保持在最底部,可以循环调用该方法 如果是div的 /*滚动条到地步*/ function to ...

  2. JS控制滚动条的位置

    转载▼http://blog.sina.com.cn/s/blog_4481a3460100rwwu.html     JS控制滚动条的位置:window.scrollTo(x,y); 竖向滚动条置顶 ...

  3. js控制treeview默认展开

    bootStrapTreeview 在bootstrap的treeview官网,可以找到这个方法,用js控制可以写成:$('#xxx').treeview('collapseNode',{silent ...

  4. js控制滚动条的位置以及隐藏滚动条

    document.documentElement.style.overflow = 'hidden'; //隐藏横竖滚动条 window.scrollTo(0,document.body.scroll ...

  5. js控制滚动条在内容更新超出时自动滚到底部

    //滚动条在内容更新时自动滚到底部var message = document.getElementById('message');message.scrollTop = message.scroll ...

  6. 《selenium2 python 自动化测试实战》(15)——调用js控制滚动条等操作

    看代码: # coding=utf-8 from time import sleepfrom selenium import webdriver driver = webdriver.Firefox( ...

  7. 爬虫实例——通过JS控制滚动条

    案例 某位淘女郎的某个相册 有能力的童鞋可以先尝试一下爬取每张照片的链接. 我曾经尝试过几种方法,下面一一介绍: 第一种方法,采用requests和BeautifulSoup: import requ ...

  8. Js控制滚动条

    1>全局控制 //向上滑动显示 var initTop = 0; var i = 1; $(window).scroll(function(){ var scrollTop = $(docume ...

  9. python 通过js控制滚动条拉取全文 通过psutil获取pid窗口句柄,通过win32gui使程序窗口前置 通过autopy实现右键菜单和另存为操作

    1.参考 利用 Python + Selenium 自动化快速截图 利用 Python + Selenium 实现对页面的指定元素截图(可截长图元素) 使用python获取系统所有进程PID以及进程名 ...

随机推荐

  1. Spark SQL 用户自定义函数UDF、用户自定义聚合函数UDAF 教程(Java踩坑教学版)

    在Spark中,也支持Hive中的自定义函数.自定义函数大致可以分为三种: UDF(User-Defined-Function),即最基本的自定义函数,类似to_char,to_date等 UDAF( ...

  2. Linux下自动备份MySQL

    使用expect和mysqldump备份 expect expect是一个免费的编程工具语言,用来实现自动和交互式任务进行通信,而无需人的干预. 例如,执行shell脚本的过程中,需要输入用户名.密码 ...

  3. index_merge引发的死锁排查

    概述 前几天排查了一个死锁问题,最开始百思不得其解,因为发生死锁的两个事务是单语句事务,语句类型相同(where属性列相同,仅值不同),而且语句都走了相同的索引,但最终确实发生了死锁.通过定位排查发现 ...

  4. 获取博客积分排名,存入数据库,读取数据进行绘图(python,selenium,matplotlib)

    该脚本的目的:获取博客的排名和积分,将抓取时间,排名,积分存入数据库,然后把最近的积分和排名信息进行绘图,查看积分或者排名的变化情况. 整个脚本的流程:是利用python3来编写,利用selnium获 ...

  5. 规范 : disable account

    前台的cookies在后台会去拿account出来,之后在filter status = disable的 用户在登入使用界面请求一个ajax,这时发现是401没有权限,这通常是admin把用户的ac ...

  6. 了解 : angular controller link ng-init 顺序

    controller 会先跑,接着是view 里的ng-init,最后是link (指令里的). 所有在指令里如果用link去拿$attr,会有拿不到ng-init想setup的值

  7. setTimeout的妙用2——防止循环超时

    上个周日,介绍了如何使用setTimeout代替setInterval进行间歇调用,这个周日,继续来讲<JavaScript高级程序设计>这本书里面,对于setTimeout的另一种妙用- ...

  8. VS.NET2010水晶报表安装部署[VS2010]

    水晶报表VS2010版IDE安装标准版SAP Crystal Reports, version for Visual Studio 2010 - Standard: 下载地址: http://down ...

  9. Git基础教程(二)

    继续上篇Git基础教程(一),在开篇之前,先回顾一下上篇中的基本命令. 配置命令:git config --global * 版本库初始化:git init 向版本库添加文件:git add * 提交 ...

  10. 学习H5一周随笔

    H5学习也已经进行了一个周了,除了学习过程中的乱哄哄的脑子,对H5初学者(我)常见的问题有了如下见解. 1.初学者在建立新的Html文件之后,有时候会把 <meta charset=" ...