I've searched for it, but I just getting more confused.
I want to use this script to show a menubar after scrolling down 200px: https://redvinestudio.com/how-to-make-a-menu-fade-in-on-scroll-using-jquery/
I set the CSS witch is self explained - to put in the custom.css
Than I put this in the functions.php (I'm using a child theme):
function add_latest_jquery() {
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://code.jquery.com/jquery-latest.js', false);
wp_enqueue_script('jquery');
}
}
add_action('wp_print_scripts ', 'add_latest_jquery');
I'm not sure if that's right, because of the !is_admin()
And I just don't know where and how to put the following:
<script type="text/javascript">
(function($) {
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 200) {
$('#menu').fadeIn(500);
} else {
$('#menu').fadeOut(500);
}
});
});
})(jQuery);
</script>
Thanks!