Comments (4)
I had a similar problem with an animation that wouldn't play multiple times even though it had been triggered.
Adding animation-direction: alternate; to the CSS did the trick for me.
from animate.css.
@dec adding animation-direction: alternate didn't fix this unfortunately!
from animate.css.
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 data-attribute
to each button and create a generic click handler (and remove the "onclick" attributes):
<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.
from animate.css.
New demo page doesn't have this issue.
from animate.css.
Related Issues (20)
- Request for a forwards fill css class parameter HOT 2
- Duplicated property name in animation.css HOT 4
- Animate only if i hit a specific section HOT 2
- Adding AOS HOT 1
- css problem in float property and box model HOT 2
- Akab
- Keep the element at the end of its animation values HOT 1
- copy button to copy code by just one click HOT 12
- Link to Hippocratic license triggers antivirus phishing alert HOT 2
- Request to Add Scroll Animations to the Repository HOT 2
- Animation intensity HOT 2
- Add .animate__animated to all .animate__animationName classes as a requisite in CSS file HOT 3
- Close List Button is not working HOT 1
- Gehe
- blank space in the document section HOT 1
- [FEATURE] Menu Icon Doesn't Hide After Click and Should Change to Cross Icon HOT 4
- License mismatch in github repo source and npmjs HOT 1
- Increase opacity class copy button
- Add copy button on important cade and command
- Animation not working on mobile IOS 17 and above
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 animate.css.