cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$(function() {
    var initIndex = 0;
 
    if(!(typeof(selectIndex) == "undefined")) {
        initIndex = selectIndex;
    } 
    n=$('.kltwowrap a').size();                
    var wh=100*n+"%";
    $('.kltwowrap').width(wh);
    var lt=(100/n/3);
    var lt_li=lt+"%";
    $('.kltwowrap a').width(lt_li);            
    $(".kltwowrap a").on('touchstart mousedown',function(e){
        e.preventDefault()
        $(".kltwowrap .active").removeClass('active');
        $(this).addClass('active');
        tabsSwiper.slideTo($(this).index());
    });
    
    $(".kltwowrap a").click(function(e){
        e.preventDefault();
    });
    
    window.onload=function(){  
        var pages = document.getElementById("swiper-pages");  
        var scale = window.screen.height / window.screen.width;  
        pages.style.height = document.body.clientWidth * scale -$('.kltit').height()-$('.kltwo').height() - 20 + "px";  
    } 
    
    var tabsSwiper = new Swiper(".swiper-container",{
        initialSlide : initIndex,
        setWrapperSize :true,
        onSlideChangeStart: function(tabsSwiper){
            $(".kltwowrap .active").removeClass('active');
            var panelIndex = tabsSwiper.activeIndex;
            var $kltwowrapA = $(".kltwowrap a").eq(panelIndex);
            $kltwowrapA.addClass('active');
            $kltwowrapA.parent().css("left",-parseInt(tabsSwiper.activeIndex/3)*tabsSwiper.width);
            query(panelIndex);
        }
    });
})