Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!DOCTYPE html> <title>My Example</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $( function() { $( "button" ).click( function() { $( "#animation" ).animate({ fontSize: "+=1.5em", letterSpacing: "+=0.3em" }, 1000 ); }); }); </script> <button>Run Animation!</button> <div id="animation">Animation</div> <p>When we use relative values (e.g. <code>+=1.5em</code>) the animation effect will happen every time we run it. This wouldn't happen if we used absolute values (e.g. <code>1.5em</code>), as the absolute value would already have been achieved with the first iteration.</p>
Preview