Animations
Bootstrap animations
Note: We are transitioning MDB4 to a legacy version and focusing on developing MDB5.
While we'll continue to support for the transition period, we encourage you to migrate to
MDB5. We're offering a huge discount on MDB5 PRO to help with your transition,
enabling you to leverage the full potential of the latest version. You can find more information here.
upgrade with discount
Bootstrap animations are illusions of motions for web elements. We offer 70+ animations generated by CSS only, all work properly on every browser.
Basic usage
Using our animations is simple.
Step 1: Add the class .animated
to the element you want to animate.
Step 2: Add one of the following classes:
.bounce
.flash
.pulse
.rubberBand
.shake
.headShake
.swing
.tada
.wobble
.jello
.jackInTheBox
.heartBeat
.bounceIn
.bounceInDown
.bounceInLeft
.bounceInRight
.bounceInUp
.bounceOut
.bounceOutDown
.bounceOutLeft
.bounceOutRight
.bounceOutUp
.fadeIn
.fadeInDown
.fadeInDownBig
.fadeInLeft
.fadeInLeftBig
.fadeInRight
.fadeInRightBig
.fadeInUp
.fadeInUpBig
.fadeOut
.fadeOutDown
.fadeOutDownBig
.fadeOutLeft
.fadeOutLeftBig
.fadeOutRight
.fadeOutRightBig
.fadeOutUp
.fadeOutUpBig
.flipInX
.flipInY
.flipOutX
.flipOutY
.lightSpeedIn
.lightSpeedOut
.rotateIn
.rotateInDownLeft
.rotateInDownRight
.rotateInUpLeft
.rotateInUpRight
.rotateOut
.rotateOutDownLeft
.rotateOutDownRight
.rotateOutUpLeft
.rotateOutUpRight
.hinge
.rollIn
.rollOut
.zoomIn
.zoomInDown
.zoomInLeft
.zoomInRight
.zoomInUp
.zoomOut
.zoomOutDown
.zoomOutLeft
.zoomOutRight
.zoomOutUp
.slideInDown
.slideInLeft
.slideInRight
.slideInUp
.slideOutDown
.slideOutLeft
.slideOutRight
.slideOutUp
Live preview
<img src="https://mdbootstrap.com/img/logo/mdb-transparent-250px.webp" class="animated bounce infinite" alt="Transparent MDB Logo" id="animated-img1">
Note: Do not add the "infinite" class if you do not want the animation to be looped.
Step 3 (additionally): You may also want to include slow, fast or delay classes or the infinite class for an infinite loop.
Select an option
Add one of the following classes:
.fast
.faster
.slow
.slower
.delay-1s
.delay-2s
.delay-3s
.delay-4s
.delay-5s
.infinite
Advanced usage
You can do a whole bunch of other stuff with animations when you combine it with jQuery or add your own CSS rules.
1. Dynamically add animations using jQuery with ease:
$('#yourElement').addClass('animated bounceOutLeft');
2. You can also detect when an animation ends:
$('#yourElement').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', doSomething);
Note: jQuery.one()
is used when you want to execute the event handler at most
once. More information here.
3. You can also extend jQuery to add a function that does it all for you:
#yourElement {
-vendor-animation-duration: 3s;
-vendor-animation-delay: 2s;
-vendor-animation-iteration-count: infinite;
}
Note: be sure to replace "vendor" in the CSS code with the applicable vendor prefixes (webkit, moz, etc).
Reveal Animations When Scrolling
Thanks to MDB you can easily launch an animation on page scroll.
Basic usage
Step 1: Initialize the script for animations when scrolling.
$( document ).ready(function() {
new WOW().init();
});
Step 2: Add the CSS class .wow
to an HTML element: it will be invisible until the user
scrolls to reveal it.
<img src="..." class="wow">
Step 3: Pick an animation style from the list of animations , then add the CSS class to the HTML element.
<img src="..." class="wow fadeInUp">
Adding multiple animations via jQuery
If you want to use the same animation throughout the entire page, you can use jQuery
addClass()
to make it once, then reuse it.
$( ".wow" ).addClass( "fadeInUp" );
visibility: hidden;
Add
visibility: hidden
to thewow
if you want to animate the element which is visible immediately after page load. Thanks to that you avoid reloading the content after javascript has loaded.
.wow {
visibility: hidden;
}
Options
Use one of the custom attributes below to change the behavior of the animations upon a scrolling.
-
data-wow-duration
: Change the animation duration -
data-wow-delay
: Delay before the animation starts -
data-wow-iteration
: Number of times the animation will be repeated
<img src="..." class="wow fadeInUp" data-wow-delay="0.6s">