increase progressbar loading time in pace.js

℡╲_俬逩灬. 提交于 2019-12-08 18:36:29

You can describe options or in data-pace-options attribute for script tag with pace.js

Or better - in simple tag script ( plain js ) BEFORE including pace.js ( to set value before library start ) like this:

<!DOCTYPE html>
<html>
<head>
  <script>
    paceOptions = {
    initialRate:0.7,
    minTime:1750,
    maxProgressPerFrame:1,
    ghostTime: 120000
}
  </script>
<script src="https://rawgit.com/HubSpot/pace/master/pace.js"></script>
   <link href="https://rawgit.com/HubSpot/pace/master/themes/green/pace-theme-barber-shop.css" rel="stylesheet" />
  <meta charset="utf-8">
  <title>Pace</title>
</head>
<body>

</body>
</html>

Try in here: http://jsbin.com/pumarikixa/1/

To change speed see eventLag options -

  eventLag : {
    minSamples: 10,
    sampleCount: 300,
    lagThreshold: 1
  }

Something like http://jsbin.com/pequdepaga/1/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!