admin管理员组文章数量:1394055
I am using pace.js
plugin, it works fine but I want that the progress bar will show for longer time, mean to increase the loading time, so user will see the loading screen for long time, by default it run fast.
I will also look at these options but can't understand where to add the code for increasing the loading time.
I try this code,
window.paceOptions={
initialRate:0.7,
minTime:1750,
maxProgressPerFrame:1,
ghostTime: 120000
}
but it will not working.
I am using pace.js
plugin, it works fine but I want that the progress bar will show for longer time, mean to increase the loading time, so user will see the loading screen for long time, by default it run fast.
I will also look at these options but can't understand where to add the code for increasing the loading time.
I try this code,
window.paceOptions={
initialRate:0.7,
minTime:1750,
maxProgressPerFrame:1,
ghostTime: 120000
}
but it will not working.
Share Improve this question edited Feb 18, 2015 at 2:25 Alexander O'Mara 60.7k19 gold badges173 silver badges181 bronze badges asked Feb 15, 2015 at 19:46 user4259777user42597771 Answer
Reset to default 5 +50You 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./HubSpot/pace/master/pace.js"></script>
<link href="https://rawgit./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./pumarikixa/1/
To change speed see eventLag options -
eventLag : {
minSamples: 10,
sampleCount: 300,
lagThreshold: 1
}
Something like http://jsbin./pequdepaga/1/
本文标签: javascriptincrease progressbar loading time in pacejsStack Overflow
版权声明:本文标题:javascript - increase progressbar loading time in pace.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744604610a2615276.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论