Skip to content

Instantly share code, notes, and snippets.

@hmowais
Created December 1, 2020 09:59
Show Gist options
  • Save hmowais/8473d5318862b9e24cdba1920316984c to your computer and use it in GitHub Desktop.
Save hmowais/8473d5318862b9e24cdba1920316984c to your computer and use it in GitHub Desktop.
Background Animation
// Enqueue Files
function theme_enqueue_styles() {
wp_enqueue_style( 'animate-style', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.0/animate.min.css', array() );
wp_enqueue_script( 'wow-js', 'https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js', array() );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function wow_js() { ?>
<script>
jQuery( document ).ready(function($) {
$('.animate_title strong').addClass('wow');
new WOW().init();
$('.reset').click(function(){
new WOW().init();
})
});
</script>
<?php }
add_action('wp_footer','wow_js');
<h1 class="animate_title">In enim justo, <strong>rhoncus </strong> adle
<strong>imperdiet </strong> a, venenatis vitae.</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment