indexsd.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. $(function(){
  2. $('.news_nav a').click(function(){
  3. $(this).addClass('hover').siblings('a').removeClass('hover');
  4. var nav_id = $(this).data('newskey');
  5. $('[data-newsVal="'+nav_id+'"]').show().siblings('.news_container').hide();
  6. });
  7. setTimeout(function(){
  8. $('[data-newsVal]').find('.news_left').css({'visibility': 'visible', 'animation-name': 'fadeInLeft'});
  9. $('[data-newsVal]').find('.news_right').css({'visibility': 'visible', 'animation-name': 'fadeInRight'});
  10. }, 400);
  11. });
  12. $(function(){
  13. $('.case_nav a').click(function(){
  14. $(this).addClass('hover').siblings('a').removeClass('hover');
  15. var nav_id = $(this).data('casekey');
  16. $('[data-caseVal="'+nav_id+'"]').show().siblings('.n_case').hide();
  17. });
  18. });
  19. var itlinks ;
  20. $(document).ready(function () {
  21. hj();
  22. $('.myhex').hover(function () {
  23. clearInterval(itlinks);
  24. }, function () {
  25. if (itlinks) {
  26. clearInterval(itlinks);
  27. }
  28. itlinks = setInterval(showNextLinks2, 3500);
  29. });
  30. });
  31. $('.myhex-next').click(function(){
  32. showNextLinks2(false);
  33. });
  34. $('.myhex-prev').click(function(){
  35. showNextLinks2(true);
  36. });
  37. var swiper = new Swiper('.swiper-banner', {
  38. pagination: '.banner-pages',
  39. nextButton: '.banner-next',
  40. prevButton: '.banner-prev',
  41. paginationClickable: true,
  42. spaceBetween: 30,
  43. centeredSlides: true,
  44. //loop: true,
  45. autoplay: 6500,
  46. autoplayDisableOnInteraction: false,
  47. effect: 'fade',
  48. onInit: function (swiper) { //Swiper2.x的初始化是onFirstInit
  49. swiperAnimateCache(swiper); //隐藏动画元素
  50. swiperAnimate(swiper); //初始化完成开始动画
  51. },
  52. onSlideChangeEnd: function (swiper) {
  53. swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
  54. },
  55. onTransitionEnd: function (swiper) {
  56. swiperAnimate(swiper);
  57. },
  58. onTouchEnd: function (swiper) {
  59. swiperAnimate(swiper);
  60. }
  61. });
  62. new Swiper('.swiper-clients', {
  63. pagination: '.clients_pages',
  64. paginationClickable: true,
  65. loop: true,
  66. autoplay: 3500,
  67. spaceBetween: 30
  68. });
  69. new Swiper('.swiper-solution', {
  70. nextButton: '.solution-next',
  71. prevButton: '.solution-prev',
  72. paginationClickable: true,
  73. spaceBetween: 30,
  74. loop: true,
  75. });
  76. var swiperCase = new Swiper('.swiper-case-ul', {
  77. speed:300
  78. });
  79. function setCaseIndex(index,that){
  80. that.addClass('on');
  81. that.siblings('a').removeClass('on');
  82. swiperCase.slideTo(index,500);
  83. }
  84. var notice = new Swiper('.swiper-notice', {
  85. direction : 'vertical',
  86. speed:300,
  87. autoplayDisableOnInteraction : false,
  88. loop : true,
  89. autoplay: 4000
  90. });
  91. $('.swiper-notice li').hover(function(){
  92. notice.stopAutoplay();
  93. },function(){
  94. notice.startAutoplay();
  95. });
  96. var isBegin = false;
  97. $(function(){
  98. $(window).scroll(function () {
  99. var u = 96;
  100. var Height = $("#easing").offset().top;
  101. var height = $("#easing").height() + 500;
  102. if ($(window).scrollTop() >= (Height-height) && $(window).scrollTop() <= (Height+height)) {
  103. if(isBegin) return false;
  104. isBegin = true;
  105. $(".num1").css('backgroundPosition','0 0');
  106. var result = '10';
  107. var num_arr = (result+'').split('');
  108. $(".num1").each(function(index){
  109. var _num = $(this);
  110. setTimeout(function(){
  111. _num.animate({
  112. backgroundPosition: '(0 '+((u*60) - (u*num_arr[index]))+'px)'
  113. },{
  114. duration: 5000,
  115. easing: "easeInOutCirc"
  116. });
  117. }, index * 900);
  118. });
  119. $(".num2").css('backgroundPosition','0 0');
  120. var result1 = '2000';
  121. var num_arr1 = (result1+'').split('');
  122. $(".num2").each(function(index){
  123. var _num = $(this);
  124. setTimeout(function(){
  125. _num.animate({
  126. backgroundPosition: '(0 '+((u*60) - (u*num_arr1[index]))+'px)'
  127. },{
  128. duration: 5000,
  129. easing: "easeInOutCirc"
  130. });
  131. }, index * 900);
  132. });
  133. $(".num3").css('backgroundPosition','0 0');
  134. var result2 = '1200';
  135. var num_arr2 = (result2+'').split('');
  136. $(".num3").each(function(index){
  137. var _num = $(this);
  138. setTimeout(function(){
  139. _num.animate({
  140. backgroundPosition: '(0 '+((u*60) - (u*num_arr2[index]))+'px)'
  141. },{
  142. duration: 5000,
  143. easing: "easeInOutCirc"
  144. });
  145. }, index * 900);
  146. });
  147. }
  148. });
  149. });
  150. skrollr.init({ forceHeight: false });
  151. function hj() {}