javascript - Fade in/out div scrollTop -


i have floating menu want fade in when start scroll down page, fade out when @ top of page. have got working without fade, im not sure how add fades. appreciated. thanks.

$(document).scroll(function() {     $('#floatingnav').toggle($(this).scrolltop()>250) }); 

css

#floatingnav {     position:fixed;     display:none; } 

you can use fadetoggle duration argument(just incase want) instead of plane toggle.that job.

$(document).scroll(function() {      $('#floatingnav').fadetoggle($(this).scrolltop()>250) }); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -