This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14800|Reply: 0

[JavaScript] Front-end library: JS page loading progress bar

[Copy link]
Posted on 1/18/2016 11:02:55 AM | | | |



Let's take a look at the renderings first:

Easy to use:

Step 1: Copy the templates folder, themes folder, pace.js, pace.min.js into the project

Step 2: Introduce CSS styles and JS scripts




Step 3: Open the page and you're done


Custom configuration

Pace.js will be automatically loaded into the page, no need to hook to any code, and the progress will be automatically detected. If you want to make some adjustments, you can set window.paceOptions to customize the configuration:





You can also put custom settings in the scrip{filter}t tag, for example:



If you use AMD or Browserify to load modules, you can set it up like this (e.g. start):



Use the API

List of APIs Pace.js public:

Pace.start: Starts showing the progress bar, if you are not using AMD or Browserify to load modules, this will be executed by default.
Pace.restart: The progress bar reloads and displays.
Pace.stop: hides the progress bar and stops loading.
Pace.track: Monitor one or more request tasks.
Pace.ignore: Ignore one or more request tasks.


File Download: pace-0.5.6.zip (153.26 KB, Number of downloads: 2)





Previous:discuz copying links does not require any modification of the file, changing the dynamic to a pseudo-static link
Next:Download the batch source code for the specified network file
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com