I am trying to load the script before the layout page load, please check my scenario in my attached video,
https://share.getcloudapp.com/p9uAR4JX
jQuery(window).load(function() {
jQuery('div.custom-metabox').hide();
setTimeout(function(){
jQuery('div.custom-metabox').fadeIn('slow');
},1000);
});
but the layout is loading before the page. how should I prevent this, I have enqueued the script like this,
wp_enqueue_script( 'custom', include_plugin_url( 'assets/js/custom.js' ), array(), $version, false );
any help will be appreciated