I want to execute a function after an element has been loaded.
jQuery's load()
event seems to make this easy, but it was deprecated in v1.8. I'm looking for a modern version of a similar thing to this:
$( "img.userIcon" ).load(function() {
if ( $( this ).height() > 100) {
$( this ).addClass( "bigImg" );
}
});
Must be cross-browser, can be jQuery or vanilla JS.