Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2017 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f32b9ea583ad0597029dccb46be43ac8 to your computer and use it in GitHub Desktop.
Save anonymous/f32b9ea583ad0597029dccb46be43ac8 to your computer and use it in GitHub Desktop.
function daily_insight_pro_child_custom_scripts() { ?>
<script type="text/javascript">
jQuery(window).scroll(function($) {
var scroll = jQuery(window).scrollTop();
//>=, not <=
if (scroll >= 100) {
//clearHeader, not clearheader - caps H
jQuery("#masthead").addClass("header-sticky");
}
else{
jQuery("#masthead").removeClass("header-sticky");
}
}); //missing );
</script>
<?php
}
add_action( 'wp_footer', 'daily_insight_pro_child_custom_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment