Currently, I am expanding my knowledge of javascript and jQuery. While working on a project website, I decided to enhance the navigation by making it smaller and transparent as users scroll through the page. This is the code snippet that I implemented:
$(document).scroll(function(){
$('.nav').css({"opacity": "0.85", "height": "55px"});
$('.nav-container').css({"margin-top": "-13px", "font-size": "1.4em"})
});
However, I would like the navigation to return to its original state once the user scrolls back to the top of the page. It seems that there isn't a specific jQuery event for this requirement.