Blame view

js/services.js 2.88 KB
4354a61b   Andy   服务页 集团部分
1
2
  
  //集团 tab 切换
eabbfe41   Andy   add service
3
4
5
6
7
8
9
10
  var mySwiper2 = new Swiper('#swiper-tab',{
      watchSlidesProgress : true,
      watchSlidesVisibility : true,
      slidesPerView : 3,//将tabs块儿平均分成几份
  
      /*点击了上面的滑块时,下面的内容区也跟着变化  若去掉后,拖动下面上面可继续移动*/
      onTap: function(){
          mySwiper3.slideTo( mySwiper2.clickedIndex)
0ac619a0   Andy   add
11
      }
0ac619a0   Andy   add
12
  
0ac619a0   Andy   add
13
  
0ac619a0   Andy   add
14
  
eabbfe41   Andy   add service
15
16
17
18
19
20
21
22
23
24
25
26
27
  })
  var mySwiper3 = new Swiper('#swiper-con',{
  
      onSlideChangeStart: function(){
          updateNavPosition()
      }
  
  })
  
  function updateNavPosition(){
  //默认哪一块是被选中的状态
      $('#swiper-tab .active-nav').removeClass('active-nav')
      var activeNav = $('#swiper-tab .swiper-slide').eq(mySwiper3.activeIndex).addClass('active-nav');
0ac619a0   Andy   add
28
  
0ac619a0   Andy   add
29
  
eabbfe41   Andy   add service
30
31
32
33
34
35
36
37
38
39
40
41
      if (!activeNav.hasClass('swiper-slide-visible')) {
          console.log(1);
          if (activeNav.index()>mySwiper2.activeIndex) {
              console.log(2);
              var thumbsPerNav = Math.floor(mySwiper2.width/activeNav.width())-1
              mySwiper2.slideTo(activeNav.index()-thumbsPerNav)
          }
          else {
              console.log(3);
              mySwiper2.slideTo(activeNav.index())
          }
      }
0ac619a0   Andy   add
42
  }
eabbfe41   Andy   add service
43
  
6debfb8d   Andy   add
44
  $('#services-soft-wrap li').on('click',function () {
4354a61b   Andy   服务页 集团部分
45
      var _index = $(this).index();
c39dc7ee   Andy   服务 add css3
46
  
54822d57   liuqimichale   服务 click 切换
47
      $('#services-wrap-sass').css('background-image','url(images/services_saasIco'+(_index+1)+'.png)')
c39dc7ee   Andy   服务 add css3
48
49
50
51
      $('#services-soft-wrap li').eq(_index).addClass('active').siblings().removeClass('active');
      $('#services-soft-wrap li').children('div').addClass('displaynone');
      $('#services-soft-wrap li').eq(_index).children('div').removeClass('displaynone');
      // $('.ai-success-stories-list-bar').css('left',100*_index);
4354a61b   Andy   服务页 集团部分
52
      $('#services-section-wrap>li').eq(_index).removeClass('displaynone').siblings().addClass('displaynone')
6debfb8d   Andy   add
53
  });
b9b68354   Andy   服务页 车场 车主模块
54
55
56
57
  
  //车场 tab 切换
  $('#services-park-wrap li').on('click',function () {
      var _index = $(this).index();
c39dc7ee   Andy   服务 add css3
58
59
60
61
62
      $('#services_parkIco').css('background-image','url(images/services_parkIco'+(_index+1)+'.png)');
      $('#services-park-wrap li').eq(_index).addClass('active').siblings().removeClass('active');
      $('#services-park-wrap li').children('div').addClass('displaynone');
      $('#services-park-wrap li').eq(_index).children('div').removeClass('displaynone');
      $('#services-section-park>li').eq(_index).removeClass('displaynone').siblings().addClass('displaynone');
b9b68354   Andy   服务页 车场 车主模块
63
64
  });
  
b48b7eca   Andy   media 服务页
65
66
67
  //车主 tab 切换
  $('#services-user-wrap li').on('click',function () {
      var _index = $(this).index();
c39dc7ee   Andy   服务 add css3
68
69
70
71
72
      $('#services_userIco').css('background-image','url(images/services_userIco'+(_index+1)+'.png)');
      $('#services-user-wrap li').eq(_index).addClass('active').siblings().removeClass('active');
      $('#services-user-wrap li').children('div').addClass('displaynone');
      $('#services-user-wrap li').eq(_index).children('div').removeClass('displaynone');
      $('#services-section-user>li').eq(_index).removeClass('displaynone').siblings().addClass('displaynone');
54822d57   liuqimichale   服务 click 切换
73
  });