Giter Club home page Giter Club logo

circular-progress's Introduction

Circles

A jQuery plugin to create a circular progress bar.


Options

rotateBy - default: 1

The amount that the progress animation should move per frame. Leave at default for a smooth animation, increase and increase the speed for a 'stepped' animation.

initialPos - default: 0

The initial position for this instance of the plugin on page load.

targetPos - default: 0

The target position to animate to from initialPos on page load. If both options are set to the same number, the plugin will not animate on load.

scale - default: 360

Number of increments round the plugin. Default uses degrees. Other likely choices would be 100 (for a percentage) or a small number of steps e.g. 5. See 'progPreText' and 'progPostText' options for how to enhance this.

speed - default: 5

Speed of the animation in milliseconds.

includeInner - default: 0

If true, make the plugin instance a 'ring' instead of a solid circle.

innerHTML - default: ''

Any markup or text to put inside the circle. Note that if this option is set there is no need to also explicitly set the includeInner option as well.

showProgress - default: 0

Include inside the circle a changing readout showing the current position of the progress. Uses whatever scale has been set.

progPreText - default: ''

Text to put before the progress output.

progPostText - default: ''

Text to put after the progress output. For example, '%'. Or you could set the pretext to 'Step ' and the posttext to ' of 5', with a scale of 5.

delayAnimation - default: 0

Milliseconds before the animation should start on plugin load.

Callbacks

onFinishMoving - called when the progress has finished moving in its current animation. Returns a value of pos, the position where it has stopped.

Public methods

moveProgress - pass a value to animate the current position to a new position.

Examples

Make a progress meter of 5 steps, loading at step 1 and animating round to step 3, with a callback when it has finished animating.

<div class="progress example1"></div>

<script>
    $('.example1').circles({
        showProgress: 1,
        initialPos:1,
        targetPos:3,
        scale: 5,
        progPreText: 'Step ',
        progPostText: ' of 5',
        delayAnimation: 1000,
        onFinishMoving:function(pos){
            console.log('stopped moving at step ',pos);
        }
    });
</script>

See http://www.custarddoughnuts.co.uk/article/2015/8/17/jquery-circular-progress-plugin-improved for examples and code snippets.

circular-progress's People

Contributors

andysellick avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ashley2014

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.