Adding CLASS After Page Load

This javascript code snippet is to add a class to an element after the page is finished loading the DOM.
Share:
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

This javascript code snippet is to add a class to an element after the page is finished loading the DOM. One possible use is so that the CSS animation that we create can be seen in the hero section because it will be executed after the visitor sees the screen, for example, we combine it with the CSS effect to enlarge the element.

var $headline = jQuery(".headline");
	jQuery(window).ready(function(){		
			$headline.addClass("grow");
	});

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Article

Fade-In Effect on Window Load
Javascript code for fade-in effect on window load
Disable AOS in Oxygen Builder Editor
CSS for disable AOS in Oxygen Builder
OpenStreetMap and Leaflet.js
Snippets code to use OpenStreetMap and Leaflet.js
COMPLETE PACKAGE OF WEBSITE DESIGN & DEVELOPMENT
Digitalizer offers website design & development services for company profiles, online shops, event organizers, educational institutions or other fields. You don't need to think about domains, web hosting / servers, DNS, email, design, development, security and other technical issues. Just prepare your website content, we do the rest.
All website design & development packages include 1 year maintenance!
Free Consultation
Back to top
cross