art.js 1.3 KB

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