Make Div Appear On Scroll In Wordpress
I can't seem to figure this one out.. I'm sure it's something simple. My goal is to make a solid filled div slide down form the top of viewport once the user has scrolled down a bi
Solution 1:
With this much info, my guess is this happens because of WordPress using noconflict.Try modifying your code like that:
<scripttype="text/javascript">jQuery(function($) {
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 50) {
$('.slide').slideDown();
} else {
$('.slide').slideUp();
}
});
});
</script>
Solution 2:
put on header.php
<scripttype="text/javascript" >jQuery(document).scroll(function() {
if ( jQuery(this).scrollTop() > 300) {
jQuery('.home-link').fadeOut(1500);
jQuery('.nav-menu a').css({ "font-weight": "bold"});
} else {
jQuery('.home-link').fadeIn();
jQuery('.nav-menu a').css({ "font-weight": ""});
}
});
</script>
beetwen <?php wp_head(); ?>
and </head>
More explained here (Spanish):
Como ocultar la cabecera de pagina WordPress al hacer Scroll + Video
Post a Comment for "Make Div Appear On Scroll In Wordpress"