Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New maximum feature #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

New maximum feature #102

wants to merge 1 commit into from

Conversation

acelot
Copy link
Contributor

@acelot acelot commented Dec 15, 2014

This feature gives you more control over the progressbar.
You can specify a maximum value of progress, if you want the progress bar stopped at this value during auto incrementing.

Example:

// Setting the goal
NProgress.max(0.3);

// Start auto incrementing
NProgress.start();

// Do something long and when it's done...
somethingLong(function() {
    NProgress.set(0.3);

    // Setting the next goal
    NProgress.max(0.6);

    // Next long process...
    nextLongProcess(function() {
        NProgress.set(0.6);

        // Release the Kraken!
        NProgress.max(1);

        // And at last...
        lastStand(function() {
            NProgress.done();
        });
    });
});
This feature gives you more control over the progressbar.
You can specify a maximum value of progress, if you want the progress bar stopped at this value during auto incrementing.

Example:

    NProgress.max(0.3);
    NProgress.start();
    
    // Do something long and when it's done...
    somethingLong(function() {
        NProgress.set(0.3);
        NProgress.max(0.6);
        
        // Next long process...
        nextLongProcess(function() {
            NProgress.set(0.6);
            
            // And at last...
            lastStand(function() {
                NProgress.done();
            })
        })
    })
@TjWallas
Copy link

👍 Yes please. Why hasn't this been merged in yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants