Topic: Trigger animations on command

ajching free asked 6 years ago


Is there a way to get the MDB animations to play when you want them to, such as through using .click()? They definitely work when I initially add the animation classes to things, but after that removing and re-adding them has no effect. Adding the class is the only way I'm aware of how to trigger the animations, so I'm wondering how this works exactly.

ajching free answered 6 years ago


After a few adjustments to work with my code, it works well! Thanks for the quick reply.

Mirosław Stasiak free answered 6 years ago


Hi, Try this script
$('#button').on('click', function() {
    $('#animationObject').removeClass().addClass('bounce animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
        $(this).removeClass();
    });
})
Let me know if everything works correctly. Regards

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags