contact.js 808 B

1234567891011121314151617181920212223242526272829
  1. /*============================================
  2. Navigation
  3. ==============================================*/
  4. $('.nav-toggle').on('touchstart click', function(e) {
  5. e.preventDefault();
  6. $( this ).toggleClass( 'active' );
  7. });
  8. $(function dw_hidenav() {
  9. var headerHeight = $('.navbar').height();
  10. $(window).on('scroll', { previousTop: 0 },
  11. function() {
  12. var currentTop = $(window).scrollTop();
  13. if (currentTop < this.previousTop) {
  14. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  15. $('.navbar').addClass('visible');
  16. } else {
  17. $('.navbar').removeClass('visible fixed');
  18. }
  19. }
  20. else {
  21. $('.navbar').removeClass('visible');
  22. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  23. }
  24. this.previousTop = currentTop;
  25. }
  26. );
  27. });