Website Loading Progress Indicator Plugin topbar.js

Add-ons
2026-07-26 00:53 3 次浏览 • 0 次下载 80.5KB
Website Loading Progress Indicator Plugin topbar.js

topbar

Release date: 2018-1-5 0:22

The website loading progress indicator has the following features:

  • Extremely small (1KB minified and compressed), with no dependencies.

  • Suitable for single-page applications.

  • Responsive.

Usage

Installation

Download topbar.js or topbar.min.js and include it in your page.

1
<script src="path/to/topbar.js"></script>

Basic Usage

Calltopbar.show()to display the progress bar,topbar.hide()to hide the progress bar. Before topbar.hide() is called, the progress bar moves increasingly slowly, but does not actually reach 100%. In most cases, these two methods are all you need.

1
2
3
4
5
6
7
$('#btnStartSimple').click(function() {
topbar.show()// Show the progress bar
})
$('#btnStopSimple').click(function() {
topbar.hide()// Hide the progress bar
})

Advanced

Use topbar.config(options) to customize the top bar.

  • autoRun (default: true): If false, call topbar.progress() manually to run the progress bar.

  • barThickness (default: 3): Progress bar thickness.

  • barColors: A list of gradient color stops used to draw the progress bar.

  • shadowBlur (default: 10): Shadow blur radius.

  • shadowColor: Shadow color.

Note:topbar.progress() accepts a numeric or string value. If a string is provided, use + or - to change the progress relative to its current position. If no parameter is specified, it returns the current progress (from 0 to 1).

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare