main.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. ;(function () {
  2. 'use strict';
  3. var owlCarousel = function(){
  4. $('#slider1').owlCarousel({
  5. loop: false,
  6. margin: 10,
  7. dots: false,
  8. nav: true,
  9. navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
  10. responsive: {
  11. 0: {
  12. items: 1
  13. },
  14. 600: {
  15. items: 3
  16. },
  17. 1000: {
  18. items: 4
  19. }
  20. }
  21. });
  22. $('#slider2').owlCarousel({
  23. loop: false,
  24. margin: 10,
  25. dots: false,
  26. nav: true,
  27. navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
  28. responsive: {
  29. 0: {
  30. items: 1
  31. },
  32. 600: {
  33. items: 2
  34. },
  35. 1000: {
  36. items: 3
  37. }
  38. }
  39. });
  40. $('#slider3').owlCarousel({
  41. loop: false,
  42. margin: 10,
  43. dots: false,
  44. nav: true,
  45. navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
  46. responsive: {
  47. 0: {
  48. items: 1
  49. },
  50. 600: {
  51. items: 2
  52. },
  53. 1000: {
  54. items: 3
  55. }
  56. }
  57. });
  58. };
  59. var videos = function() {
  60. $(document).ready(function () {
  61. $('#play-video').on('click', function (ev) {
  62. $(".fh5co_hide").fadeOut();
  63. $("#video")[0].src += "&autoplay=1";
  64. ev.preventDefault();
  65. });
  66. });
  67. $(document).ready(function () {
  68. $('#play-video_2').on('click', function (ev) {
  69. $(".fh5co_hide_2").fadeOut();
  70. $("#video_2")[0].src += "&autoplay=1";
  71. ev.preventDefault();
  72. });
  73. });
  74. $(document).ready(function () {
  75. $('#play-video_3').on('click', function (ev) {
  76. $(".fh5co_hide_3").fadeOut();
  77. $("#video_3")[0].src += "&autoplay=1";
  78. ev.preventDefault();
  79. });
  80. });
  81. $(document).ready(function () {
  82. $('#play-video_4').on('click', function (ev) {
  83. $(".fh5co_hide_4").fadeOut();
  84. $("#video_4")[0].src += "&autoplay=1";
  85. ev.preventDefault();
  86. });
  87. });
  88. };
  89. var googleTranslateFormStyling = function() {
  90. $(window).on('load', function () {
  91. $('.goog-te-combo').addClass('form-control');
  92. });
  93. };
  94. var contentWayPoint = function() {
  95. var i = 0;
  96. $('.animate-box').waypoint( function( direction ) {
  97. if( direction === 'down' && !$(this.element).hasClass('animated-fast') ) {
  98. i++;
  99. $(this.element).addClass('item-animate');
  100. setTimeout(function(){
  101. $('body .animate-box.item-animate').each(function(k){
  102. var el = $(this);
  103. setTimeout( function () {
  104. var effect = el.data('animate-effect');
  105. if ( effect === 'fadeIn') {
  106. el.addClass('fadeIn animated-fast');
  107. } else if ( effect === 'fadeInLeft') {
  108. el.addClass('fadeInLeft animated-fast');
  109. } else if ( effect === 'fadeInRight') {
  110. el.addClass('fadeInRight animated-fast');
  111. } else {
  112. el.addClass('fadeInUp animated-fast');
  113. }
  114. el.removeClass('item-animate');
  115. }, k * 50, 'easeInOutExpo' );
  116. });
  117. }, 100);
  118. }
  119. } , { offset: '85%' } );
  120. // }, { offset: '90%'} );
  121. };
  122. var goToTop = function() {
  123. $('.js-gotop').on('click', function(event){
  124. event.preventDefault();
  125. $('html, body').animate({
  126. scrollTop: $('html').offset().top
  127. }, 500, 'swing');
  128. return false;
  129. });
  130. $(window).scroll(function(){
  131. var $win = $(window);
  132. if ($win.scrollTop() > 200) {
  133. $('.js-top').addClass('active');
  134. } else {
  135. $('.js-top').removeClass('active');
  136. }
  137. });
  138. };
  139. $(function(){
  140. owlCarousel();
  141. videos();
  142. contentWayPoint();
  143. goToTop();
  144. googleTranslateFormStyling();
  145. });
  146. }());
  147. function googleTranslateElementInit() {
  148. new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
  149. }