Created
June 5, 2017 03:58
-
-
Save anonymous/f32b9ea583ad0597029dccb46be43ac8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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