Comments (6)
i can stop the circel but then , how can i restart it ?
from jquery-circle-progress.
Hi!
Currently you may stop animation with next:
$(el.circleProgress('widget')).stop();
Full example
var el = $('.circle');
el.circleProgress({ value: 0.5 });
setTimeout(function () {
$(el.circleProgress('widget')).stop();
}, 500);
I understand that it's not obvious, so it's good idea to include special "stop" method in next version.
I will leave this issue open to not forget to do this.
from jquery-circle-progress.
Thanks, its works perfectly.
from jquery-circle-progress.
I decided not to implement it (because it brings an ambiguity about current value) but to mention the solution in documentation.
from jquery-circle-progress.
I personaly redraw it with the correct values :
In the progress function I update a stepValueLeft variable
self.stepValueLeft = self.timeDuration-self.timeDuration*stepValue;
Then I have declared a restart function like this one below :
this.restart = function(){
myObject.circleProgress({
value:1,
animationStartValue: this.stepValue,
animation:{
duration: this.stepValueLeft,
easing: "linear"
}
});
};
Probably not the most optimal solution but it works fine.
from jquery-circle-progress.
This worked great to stop it but for some reason it's triggering the circle-animation-end event. I had to change the event to a circle-animation-progress and time the event in order to prevent my actions from triggering too early.
UPDATE:
I decided to try again from scratch and the circle-animation-end behaved properly this time. No idea why the first attempt failed. I suspect I had some bad math in triggering my stop.
Also, for those who needed help executing a restart I managed to stop and restart from where the bar left off by grabbing circle-animation-progress value:
.on('circle-animation-progress', function(e,p,v) {
newStartValue = v.toPrecision(2);
});
from jquery-circle-progress.
Related Issues (20)
- Adding to Google Web Designer
- Drawing a rectangle
- Unable to import in a vue project
- Add a drop shadow to the circles
- Conflict With Other Libraries (Waypoints) when loading with RequireJs, Loads jquery twice
- Progress Bar is moving faster than percentage HOT 1
- RTL HOT 1
- Arc inside circle
- Load animation on viewport
- NaN
- allow passing custom jQuery into UMD factory
- Text in the middle of the circle HOT 5
- How to stop and start (circleProgress)
- How to Change Color Dynamically on "circle-animation-progress"
- Can it be set as 100% based on Seconds? HOT 1
- startAngle seems HOT 2
- [Solved] Change the class
- Can we make the color change at 100% and above?
- How to add gradient color through html like the way we add color ?? (<div class="circle" data-fill="{ "color": "rgba(0, 0, 0, .3)" }" ></div>) HOT 1
- No onDone function support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-circle-progress.