Looking for some help with a Javascript issue on my website (http://www.pjsmusic.com). I need a div of 200px to appear when the user scrolls down 40px. I have tried using the following Javascript code:
$(document).scroll(function() {
$('#jerkBox').toggle($(this).scrollTop()> 40);
});
The problem is that the div appears when the page loads, even if it hasn't been scrolled from the top. How can I make the div appear only when the user scrolls 40px down, and disappear when they scroll back up past 40px, without showing on load? If you visit the link, you'll see what I mean. Thank you for any assistance!