Giter Club home page Giter Club logo

Comments (6)

openroc avatar openroc commented on June 9, 2024

w/o changing source code, I add unbind in event callback to fix this issue temporarily:

.on('circle-animation-end', function(event){
    //blabla ......
    $(this).unbind();
});

from jquery-circle-progress.

kottenator avatar kottenator commented on June 9, 2024

Hi!

Sorry for delayed reply. Could you, please, give an example, how exactly can I reproduce this issue? (full code example)

from jquery-circle-progress.

henrik1234 avatar henrik1234 commented on June 9, 2024

@kottenator

First of, awesome plugin many thanks.
See code below, "end" will be called twice(directly and when animation is finished).

$('.preloader .circle').circleProgress({
    value: 1,
    size: 100,
    emptyFill: "rgba(68,68,68,1)",
    fill: {
         color: "#ffba00"
    }}).on('circle-animation-end', function(event) {
            console.log( "end" )
    });

Adding javascript el.unbind(); to src will fix this

from jquery-circle-progress.

kottenator avatar kottenator commented on June 9, 2024

But it's absolutely normal behavior. You attach event handler twice - and it's triggered twice.

If you want to re-use the same circle but to trigger the event only once, do next:

$('.preloader .circle').circleProgress({
    value: 1,
    size: 100,
    emptyFill: "rgba(68,68,68,1)",
    fill: {
         color: "#ffba00"
    }
});

$('.preloader .circle').on('circle-animation-end', function(event) {
    console.log("end");
});

// event is triggered once

$('.preloader .circle').circleProgress({
    // ...
});

// event is triggered once more, but not twice

from jquery-circle-progress.

kottenator avatar kottenator commented on June 9, 2024

Have I solved your problem? Or haven't I understood it?

from jquery-circle-progress.

henrik1234 avatar henrik1234 commented on June 9, 2024

Hi,

Sorry for the late reply. Yes thanks I updated my code with your and it worked perfect.

from jquery-circle-progress.

Related Issues (20)

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.