Keyframes / jQuery.Keyframes

jQuery-Keyframes allows dynamic generation of CSS3 keyframes with callback events and other niceness.
http://keyframes.github.io/jQuery.Keyframes/
MIT License
293 stars 90 forks source link

Multiple keyframes creating an infinite loop #68

Closed firynth closed 6 years ago

firynth commented 6 years ago
function animatePrinny() {
  $("#prinnyDOOD").playKeyframe({
    name: 'slideUpHalf',
    duration: "3000ms",
    iterationCount: 1,
    "complete" : function(){
        setTimeout(function() {
            $("#exclamation").show();
        }, 200);
        loadAudio("tindeck_1.mp3", function() {
            $("#exclamation").hide();
            $("#prinnyDOOD").playKeyframe({
                name: 'slideUp',
                duration: '500ms',
                iterationCount: 1,
                "complete" : function() {
                    loadAudio("thanksdood.wav", function() {
                        $("#prinnyDOOD").playKeyframe({
                            name: 'slideDown',
                            duration: "500ms",
                            "complete" : function() {
                                playAnimation();
                                $("#prinnyDOOD").resetKeyframe();
                            }
                        });
                    });
                }
            });
        });
      }
  });
}

This code causes the animations and the sounds to play infinitely, causing the audio files to get louder and louder and louder. It didn't happen before the latest update.

krazyjakee commented 6 years ago

Thanks for the report. Could you please create a minimal example is jsfiddle or codepen so I can recreate this issue?

EDIT: I got it, thanks very much! https://jsfiddle.net/x3ou8ejv/

krazyjakee commented 6 years ago

The fix is in 1.0.3 now deployed. Check this working example: https://jsfiddle.net/x3ou8ejv/

firynth commented 6 years ago

Looks like that fixed the issue. Thanks!