Animated headlines, with interchangeable words that replace one another through CSS transitions.
npm install animated-headlines-vanilla
bower install animated-headlines-vanilla
Include the css in your head.
<link rel="stylesheet" src="dist/css/animated-headline.css">
Use the following markup.
<div class="selector">
<h1 class="ah-headline">
<span>My favorite food is</span>
<span class="ah-words-wrapper">
<b class="is-visible">pizza</b>
<b>sushi</b>
<b>steak</b>
</span>
</h1>
</div>
Finally, initialize the plugin.
<script src="dist/js/animated-headline.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
AnimatedHeadline('.animatedHeadline');
});
</script>
The plugin provides multiple options to customize the animation type and delay.
<script>
document.addEventListener('DOMContentLoaded', function () {
AnimatedHeadline('.animatedHeadline', {
animationType: 'type'
});
});
</script>
It is recommended to use the default delay options. Because of this, I won't list them below. See src/js/jquery.animatedheadline.js
for a complete list of options.
Name | Type | Default | Description |
---|---|---|---|
animation-type | string | rotate-1 | Type of animation used. Options:
|
jQuery Animated Headlines is open-sourced software licensed under the MIT license.