我正在使用pace.js插件,它工作良好,但我希望进度条显示更长的时间,意味着增加加载时间,因此用户将看到加载屏幕很长时间,默认情况下它运行很快。我还将查看这些选项,但不知道在哪里添加代码以增加加载时间。
我试试这个密码,
window.paceOptions={
initialRate:0.7,
minTime:1750,
maxProgressPerFrame:1,
ghostTime: 120000
} 但这是行不通的。
发布于 2015-02-19 02:21:00
您可以用pace.js描述脚本标记的选项或数据空间选项属性。
或者更好的是,在包含pace.js (在库启动之前设置值)之前,在简单标记脚本(普通js )中这样做:
<!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>试试这里:http://jsbin.com/pumarikixa/1/
要改变速度,请参阅eventLag选项-
eventLag : {
minSamples: 10,
sampleCount: 300,
lagThreshold: 1
}有点像http://jsbin.com/pequdepaga/1/
https://stackoverflow.com/questions/28530354
复制相似问题