• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

jQuery End Event

Hi Experts-

I have the following code and it works by hiding the navmenu when the user scrolls.  The problem is that after they've scrolled to the proper location, the navmenu doesn't re-appear.

Can you tell me how to have it disappear while the user is scrolling, but reappear after they've stopped moving the scroll bar?


Any help would be appreciated.
<script type="text/javascript">
	$(document).ready(function() {
		$(window).scroll(function() {
			$("#navmenu").css( {
				display: "none"
				});
			});
		});
</script>

Open in new window

0
quaziblue
Asked:
quaziblue
  • 4
  • 2
2 Solutions
 
tdotCommented:
0
 
tdotCommented:
Then do something like this....
<script type="text/javascript">
        $(document).ready(function() {
                $(window).scroll(function() {
                        $("#navmenu").css( {
                                display: "none"
                                });
                        });
         
        $(window).bind('scrollstop', function(){
        $("#navmenu").show();});
    });
 });
</script>
0
 
quaziblueAuthor Commented:
Is there a way to do it without downloading another plugin?  I'm trying to keep the amount of code to a minimum.  I would think there would be an even that is associated with a scroll stop already in the latest release of jquery.

I just thought of something.  What if I animate the navmenu for a few milliseconds, enough for the scroll to complete.  If you have an idea on how to do this, let me know.  I'm new with jQuery and it took me 45 minutes to come up with the above code.

Thanks.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
quaziblueAuthor Commented:
I can't figure it out.  I went to the link you suggested and there is nothing to download.
0
 
quaziblueAuthor Commented:
Just figured it out.
0
 
quaziblueAuthor Commented:
And here she is.  Ain't she a beauty?
<script type="text/javascript">
	$(document).ready(function() {
		$(window).scroll(function () { 
		      $('#navmenu').css('display', 'none').fadeIn('slow'); 
		});
	});
</script>

Open in new window

0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now