
调用方法:
引入Pace.js以及主题文件即可:
<head> <script src="/pace/pace.js"></script> <link href="/pace/themes/pace-theme-barber-shop.css" rel="stylesheet" /></head>自定义配置:
paceOptions = { // Disable the "elements" source elements: false, // Only show the progress on regular and ajax-y page navigation, // not every request restartOnRequestAfter: false}你也可以将自定义设置放到script标签内,例如:<script data-pace-options="{ "ajax": false }" src="pace.js"></script>如果你使用AMD或者Browserify来加载模块的话,你可以通过这样子来设置(例如:start):define(["pace"], function(pace){ pace.start({document: false });});使用API: