12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- $('.nav-toggle').on('touchstart click', function(e) {
- e.preventDefault();
- $( this ).toggleClass( 'active' );
- });
- $(function dw_hidenav() {
- var headerHeight = $('.navbar').height();
- $(window).on('scroll', { previousTop: 0 },
- function() {
- var currentTop = $(window).scrollTop();
- if (currentTop < this.previousTop) {
- if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
- $('.navbar').addClass('visible');
- } else {
- $('.navbar').removeClass('visible fixed');
- }
- }
- else {
- $('.navbar').removeClass('visible');
- if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
- }
- this.previousTop = currentTop;
- }
- );
- });
|