浏览器Console引入jQuery

  1. var jquery = document.createElement('script');
  2. jquery.src = 'https://cdn.bootcss.com/jquery/3.2.0/jquery.js';
  3. document.getElementsByTagName('head')[0].appendChild(jquery);
  4. jQuery.noConflict();

浏览器自动滚动

  1. var int_timer = setInterval(function(){
  2. var autoRun = 300; // 每次自动滚动的高度
  3. var nowHeight = $("#scrolling-child").scrollTop(); // 获取浏览器滚动条元素的滚动条当前高度
  4. $("#scrolling-child").animate({scrollTop:nowHeight + autoRun}, 200); //自动滚动
  5. },500)

停止滚动

  1. window.clearInterval(int_timer)

回到顶部

  1. $("#scrolling-child").scrollTop();