I'm trying to use jQuery to hide a div when the page loads, but when you scroll down to a certain point it will fade in. Right now the below script will do almost that, the problem I'm having is that the div is visible at first on page load, I want to hide it... I can't seem to figure out how.
$(window).bind("scroll", function() {
if ($(this).scrollTop() > 180) {
$("#magrig").fadeIn('slow');
}
else {
$("#magrig").stop().fadeOut('fast');
}
});
I've tried adding .hide() into the script, but I can't figure out how to reformat it.
I got it origonally from here: Fade in div after scrolling
Any help is greatly appreciated!