index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //轮播图
  2. let bannerSwiper = new Swiper('.banner-swiper', {
  3. direction: 'horizontal',
  4. speed: 300,
  5. loop: true, // 循环模式选项
  6. autoplay: {
  7. delay: 30000, //5秒切换一次
  8. },
  9. pagination: {
  10. el: '.banner-swiper .swiper-pagination',
  11. clickable: true
  12. },
  13. })
  14. let caseSwiper = new Swiper(".case-swiper", {
  15. effect: "horizontal",
  16. loop: false,
  17. on: {
  18. transitionEnd: function(data) {
  19. $('.product-tab .active').removeClass('active');
  20. $('#product-tab-item' + data.activeIndex).addClass('active');
  21. }
  22. }
  23. });
  24. $('.product-tab-item').click(function() {
  25. caseSwiper.slideTo($(this).attr('name'))
  26. })
  27. let solutionIndex = 0;
  28. let solutionSwiper = new Swiper(".solution-swiper", {
  29. effect: "horizontal",
  30. loop: false,
  31. on: {
  32. transitionEnd: function(data) {
  33. solutionIndex = data.activeIndex;
  34. solutionItemActive(solutionIndex);
  35. }
  36. }
  37. });
  38. $('.solution-item').click(function() {
  39. solutionSwiper.slideTo($(this).attr('name'))
  40. })
  41. function solutionItemActive(index) {
  42. $('.solution-tab .active').removeClass('active');
  43. $('.solution-item').eq(index).addClass('active');
  44. $('.solution-item-bg').css({
  45. left: index * 162 + 'px'
  46. })
  47. }
  48. $('.nav-link').click(function() {
  49. $('.nav-link-active').removeClass('nav-link-active');
  50. $(this).addClass('nav-link-active');
  51. let top = !$(this).attr("to") ? 0 : $($(this).attr("to")).offset().top;
  52. $("html, body").animate({
  53. scrollTop: top
  54. }, {
  55. duration: 500,
  56. easing: "swing"
  57. });
  58. return false;
  59. })
  60. $('.register').click(function() {
  61. window.location.href = '/console/index.html'
  62. })
  63. $('.gonghai').click(function() {
  64. window.location.href = '/console/index.html/#/website/home'
  65. })
  66. $('.jianzao').click(function() {
  67. window.location.href = 'https://www.youjiyun.net/console/index.html'
  68. })