I have a <div> element that i want to show only when the page is scroll for 200 or 300px, but sure i dont want to see this element when the page its open…i have try this jQuery but its not working good…
<script>
jQuery(document).scroll(function ($) {
var y = $(this).scrollTop();
if (y > 200) {
$('.scroll_div').fadeIn();
} else {
$('.scroll_div').fadeOut();
}
});
</script>
I have again same problem, the element its not hidden when the page its opened for first time, but when i scroll down and and go up again in top this jQuery its working.