Difference between revisions of "Template:Washington"
Line 360: | Line 360: | ||
}); | }); | ||
+ | /* to make the sidebar anchor*/ | ||
+ | $(document).ready(function(){ | ||
+ | $(window).scroll(function(){ | ||
+ | var window_top = $(window).scrollTop() + 12; // the "12" should equal the margin-top value for nav.stick | ||
+ | var div_top = $('#nav-anchor').offset().top; | ||
+ | if (window_top > div_top) { | ||
+ | $('nav').addClass('stick'); | ||
+ | } else { | ||
+ | $('nav').removeClass('stick'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
</script> | </script> | ||
</head> | </head> |
Revision as of 23:13, 13 September 2015