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
Test page doesn't replay animations #3
Comments
I had a similar problem with an animation that wouldn't play multiple times even though it had been triggered. |
@dec adding animation-direction: alternate didn't fix this unfortunately! |
it needs to happen on a timeout or you need to stop and remove the animation before setting a new one: //"poor code" just to test on the console
$('.butt-small:first').click(function(evt){
//just to block the current `onclick` and the link itself
evt.preventDefault();
evt.stopPropagation();
var $at = $('#animateTest').removeClass();
//timeout is important !!
setTimeout(function(){
$at.addClass('flash')
}, 10);
}); I would probably add a <a href="#cta" class="butt butt-small butt-anim" data-anim="flash">flash</a> jQuery(document).ready(function($){
var destAnim = '',
$animateTest = $('#animateTest');
function animateOnClick(evt){
$animateTest.removeClass();
//need to add a `data-anim="animationName"` to each btn
destAnim = $(this).data('anim');
setTimeout(addDestAnimClass, 10);
}
function addDestAnimClass(){
$animateTest.addClass(destAnim);
}
//need to add a class '.butt-anim' to each btn that toggles animations
$('.butt-anim').live('click', animateOnClick);
}); I was going to fork it and do it but then I realized the project page isn't a gh-pages banch.. cheers. |
New demo page doesn't have this issue. |
Clicking on a test button on the home page more than once will not work - the user must click on another test, then return to the desired test.
It appears that the .removeClass().addClass() jQuery function is executing too quickly. I've also tried adding a relatively short delay, but no success.
The text was updated successfully, but these errors were encountered: