desk.js 1.0 KB

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