Trouble adding inline style after jQuery in the footer!

You are trying to load your inline js script after jQuery just by calling add_action( 'wp_footer', 'myscript' ); after wp_enqueue_script( 'jquery' );

But this will not load your myscript after jQuery. It is not how wp_footer and wp_enqueue_script works.

wp_footer has a third argument named “priority”.

add_action( 'wp_footer', 'your_function', 100 ); //100 is priority here. larger the priority later that script will be executed.

Enqueued scripts are executed at priority level 20 using wp_footer.

And if you don’t supply any third priority, script will be enqueued at priority 10 by default (Which means your script will be included before jQuery as you have not given any priority).

So you need to call your function after priority 20.
For example:

add_action( 'wp_footer', 'myscript',50 );

try adding your script using above modification, it should work.