by Arya Dhiratara on WordPress.org
Animate any Elements on scroll using the popular AOS JS library simply by adding class names.
Animate any Elements on scroll using the popular AOS JS library simply by adding class names.
This plugin helps you integrate easily with AOS JS library to add any AOS animations (on scroll animation) to WordPress.
It should work well with the native gutenberg core blocks or any page builder (tested with GenerateBlocks and Elementor) that provides an input field for adding custom class names to elements.
AOS is a small JavaScript library built by Michał Sajnóg that allows you to add animated effects to HTML elements when they come into view as the user scrolls down a webpage. AOS provides a set of predefined animations using CSS that can be easily applied to elements using simple data attributes in the HTML code.
Check out the AOS demo and documentation.
Simply add the desired AOS animation to your element class name with “aos-” prefix and the plugin will add the corresponding aos attribute to the element tag.
Fade animations:
Flip animations:
Slide animations:
Zoom animations:
By default, the global animation settings are
you can change that using filter:
add_filter( 'aos_init', function($aos_init) {
return '
var aoswp_params = {
"offset":"200",
"duration":"1800",
"easing":"ease-in-out",
"delay":"0",
"once": false};
';
} );
or add the extra classes below to the element for individual settings. The plugin will add the corresponding aos attribute to the tag.
Once behavior:
Easing functions:
Animation Duration:
Animation Delay: (*new, added in 1.0.2)
aoswp-disable-desktop class name to the element tagaoswp-disable-mobile class name to the element tagTo disable animations site-wide / per page basis on specific devices:
add this lines to your css files:
@media ( your media query ) {
html:not(.no-js) .aoswp-enabled [data-aos] {
opacity: 1!important;
-webkit-transform: none!important;
transform: none!important;
transition: none!important;
transition-timing-function: unset!important;
transition-duration: unset!important;
transition-property: none!important;
}
}
aos-‘ in the page’s html. So this plugin will not add bloat to pages that do not use/need the AOS animations.This plugin doesn’t add anything to your database and won’t do any permanent change to your HTML, so you can safely deactivate and delete it when you no longer need it.
no-lazy or skip-lazy class.