i am trying to hide #header on scroll down event and then reappear on page scroll up.
page link :- http://elementsmart.com/product-category/jewellery/
the javascript code i used
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript">
$('#primary').scroll(function(){
if($(this).scrollTop() > 300) $('#header').fadeOut('slow');
if($(this).scrollTop() < 300) $('#header').fadeIn('slow');
});
</script>
CSS
#header-container {
position:fixed !important;
margin-left:1.6% !important;
z-index:999 !important;
}
when someone scrolls primary need the header to hide.
tried on jsfiddle seems to be working perfect but on page its now showing .
can someone guide ?
Almost done, change
to
Also wrap your code with