desk.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. new WOW().init();
  2. jQuery(document).ready(function($) {
  3. $(window).bind('load', function() {
  4. $('#loader').fadeOut(100);
  5. });
  6. $(function() {
  7. $("img.alignnone").lazyload();
  8. });
  9. /*============================================
  10. Navigation
  11. ==============================================*/
  12. $('.nav-toggle').on('touchstart click', function(e) {
  13. e.preventDefault();
  14. $( this ).toggleClass( 'active' );
  15. });
  16. $(function dw_hidenav() {
  17. var headerHeight = $('.navbar').height();
  18. $(window).on('scroll', { previousTop: 0 },
  19. function() {
  20. var currentTop = $(window).scrollTop();
  21. if (currentTop < this.previousTop) {
  22. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  23. $('.navbar').addClass('visible');
  24. $('.site-title a').removeClass('light');
  25. } else {
  26. $('.navbar').removeClass('visible fixed');
  27. }
  28. }
  29. else {
  30. $('.navbar').removeClass('visible');
  31. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  32. }
  33. this.previousTop = currentTop;
  34. }
  35. );
  36. });
  37. });