chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// JavaScript Document
$(function(){
    var curpage=1;
    var totalpage,nextpage,lastpage,nexttotalpage;
    totalpage = $(".page").length;
    nexttotalpage = totalpage + 1;
 
    window.onload = function(){
        $(".loader").css("z-index","1");
        $(".upicon").css("z-index","1000");
        initAudio("audio");
    }
 
    var audio;
    function initAudio(id){
        audio =  document.getElementById(id);
    }
    document.addEventListener(‘touchmove‘,function(event){
        event.preventDefault(); },false);
 
//控制音乐播放停止和音乐ico图标变换
 
    $(".page").swipeUp(function(){
        swichpage();
    })
 
    $("#audioPlay").on(‘click‘,function(){
        if(audio.paused){
            audio.play();
            this.style.backgroundImage="url({yun:}$wap_style{/yun}/images/music_play.png)";
        }else{
            audio.pause();
            this.style.backgroundImage="url({yun:}$wap_style{/yun}/images/music_pause.png)";
        }
    });
 
    function swichpage() {
 
//判断当前页是否为最后一页
 
        //获取总页数,以及总页数的+1后的序号,供后面for循环使用
 
        //如果是最后一页,显示第一页,并移除所有page上的所有css效果类,否则显示下一页,并移除上一页的切换动画效果
        if (curpage == totalpage) {
            for (var i = 1; i < nexttotalpage; i++) {
                $(".page" + i).removeClass("hide");
                $(".page" + i).removeClass("show");
                $(".page" + i).removeClass("pt-page-moveFromBottomFade");
            }
            $(".page1").addClass("show");
            $(".page1").addClass("pt-page-moveFromBottomFade");
            curpage = 1;
        } else {
            nextpage = curpage + 1;
            lastpage = curpage - 1;
            $(".page" + curpage).removeClass("pt-page-moveFromBottomFade");
            $(".page" + curpage).addClass("pt-page-moveToTopFade");
            $(".page" + curpage).removeClass("show");
            $(".page" + curpage).addClass("hide");
            $(".page" + nextpage).removeClass("hide");
            $(".page" + nextpage).addClass("show");
            $(".page" + nextpage).addClass("pt-page-moveFromBottomFade");
            $(".page" + lastpage).removeClass("pt-page-moveToTopFade");
            curpage = nextpage;
        }
    }
})
//the end
   curpage = nextpage;
        }
    }
  setInterval(function(){
        swichpage();
    },4000);
})
// the end