main.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. Page: main JS
  3. Author: Surjith S M
  4. URI: http://surjithctly.in/
  5. Version: 1.0
  6. */
  7. (function($) {
  8. "use strict";
  9. /* ============= Preloader Close on Click ============= */
  10. if ($('.loader-wrapper').length) {
  11. $('.loader-wrapper').on('click', function() {
  12. $(this).fadeOut();
  13. });
  14. }
  15. /* ============= Homepage Slider ============= */
  16. if ($('.flexslider').length) {
  17. $('.flexslider').flexslider({
  18. animation: "fade"
  19. });
  20. }
  21. /* ============= Partner Logo Carousel ============= */
  22. if ($('.logo-slides').length) {
  23. $(".logo-slides").owlCarousel({
  24. autoplay: true,
  25. autoplayTimeout: 3000,
  26. loop: true,
  27. margin: 10,
  28. nav: false,
  29. responsiveClass: true,
  30. responsive: {
  31. 0: {
  32. items: 1
  33. },
  34. 480: {
  35. items: 2
  36. },
  37. 767: {
  38. items: 3
  39. },
  40. 991: {
  41. items: 4
  42. },
  43. 1199: {
  44. items: 5
  45. }
  46. }
  47. });
  48. }
  49. /* ============= Percentage Slider ============= */
  50. if ($('#skills').length) {
  51. var skillsDiv = $('#skills');
  52. $(window).on('scroll', function() {
  53. var winT = $(window).scrollTop(),
  54. winH = $(window).height(),
  55. skillsT = skillsDiv.offset().top;
  56. if (winT + winH > skillsT) {
  57. $('.skillbar').each(function() {
  58. $(this).find('.skillbar-bar').animate({
  59. width: $(this).attr('data-percent')
  60. }, 2000);
  61. });
  62. }
  63. });
  64. }
  65. /* ============= Service Slider ============= */
  66. if ($('.service-slider').length) {
  67. $('.service-slider').flexslider({
  68. animation: "slide",
  69. controlNav: false,
  70. directionNav: true,
  71. touch: true
  72. });
  73. }
  74. /* ============= Blog Slider ============= */
  75. if ($('.blog-slide').length) {
  76. $('.blog-slide').flexslider({
  77. controlNav: false,
  78. animation: "slide"
  79. });
  80. }
  81. /* ============= Stats Counter ============= */
  82. if ($('.counter').length) {
  83. $('.counter').counterUp({
  84. delay: 10,
  85. time: 1500
  86. });
  87. }
  88. $(window).load(function() {
  89. /* ============= Preloader ============= */
  90. if ($('.loader-wrapper').length) {
  91. $('.loader-wrapper').fadeOut();
  92. }
  93. }); // End Window.Load
  94. })(jQuery);