Nprogress.js Template

Source: Internet
Author: User

Nprogress.js: Loading progress bar: http://ricostacruz.com/nprogress/

Based on these several methods

It's on the site.

I see this code in one place

    nprogress.configure ({        '<div class= ' bar ' role= ' bar ' style= ' background:white ' > <div class= "Peg" style= "box-shadow:0 0 10px #fff, 0 0 5px #fff;" ></div></div><div class= "Spinner" role= "spinner" ><div class= "Spinner-icon" style= " Border-top-color:white;border-left-color:white "></div></div>"    });

What do you say?

Can't you see it on the website?

And then I figured it out on the page.

You used this plugin.

And then you define the load bar and the control bar that loads the scroll.

You can add these two lines of code.

The display on the page is

<div id="nprogress"><divclass="Bar"role="Bar"style="background:red; Transform:translate3d ( -0.6%, 0px, 0px); Transition:all 200ms ease;"><divclass="Peg"style="box-shadow:0 0 10px #fff, 0 0 5px #fff;"></div></div><divclass="Spinner"role="Spinner"><divclass="Spinner-icon"style="Border-top-color:white;border-left-color:white"></div></div></div>

You see that?

It turns into something like this.

Configure as the name implies is the meaning of configuration

Template is the meaning of templates.

is to put this template in nprogress.

<script type="text/javascript">        $ (function () {            nprogress.configure ( {                Template: $ ('#myId'//  template is the property used to set the animation style            });            Nprogress.start ();        });        $ (window). Load (function () {            nprogress.done ();        })     </script>

This myid you can be on the page, you can also define in JS

And then you can introduce the template like this.

Yes

Role=bar: Horizontal Load Bar

          Role=spinner Rotating Small Circle 

This blog is also recommended http://www.cnblogs.com/xuange306/p/5122451.html this blog is very clear, you can go and see it.

Nprogress.js Template

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.