art.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. jQuery(document).ready(function($) {
  2. $(window).bind('load', function() {
  3. $('#loader').fadeOut(100);
  4. });
  5. $('.nav-toggle').on('touchstart click', function(e) {
  6. e.preventDefault();
  7. $( this ).toggleClass( 'active' );
  8. });
  9. $(function dw_hidenav() {
  10. var headerHeight = $('.navbar').height();
  11. $(window).on('scroll', { previousTop: 0 },
  12. function() {
  13. var currentTop = $(window).scrollTop();
  14. if (currentTop < this.previousTop) {
  15. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  16. $('.navbar').addClass('visible');
  17. $('.site-title a').removeClass('light');
  18. } else {
  19. $('.navbar').removeClass('visible fixed');
  20. }
  21. }
  22. else {
  23. $('.navbar').removeClass('visible');
  24. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  25. }
  26. this.previousTop = currentTop;
  27. }
  28. );
  29. });
  30. $('#gallery').carousel({
  31. interval: 5000,
  32. wrap: true,
  33. });
  34. $(document).bind('keyup', function(e) {
  35. if(e.which === 39){
  36. $('#gallery').carousel('next');
  37. }
  38. else if(e.which === 37){
  39. $('#gallery').carousel('prev');
  40. }
  41. });
  42. $('.prev').click(function() {
  43. $('#gallery').carousel('prev');
  44. });
  45. $('.next').click(function() {
  46. $('#gallery').carousel('next');
  47. });
  48. });