kimi
2021-02-18 749a5510a9f014446a3cd6ba57b3cb0cc8148dc1
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html>
 
    <head>
        <meta charset="utf-8">
        <title>Hello MUI</title>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
 
        <link rel="stylesheet" href="../css/mui.min.css">
        <style>
            html,
            body {
                background-color: #efeff4;
            }
            
            .mui-bar~.mui-content .mui-fullscreen {
                top: 44px;
                height: auto;
            }
            
            .mui-pull-top-tips {
                position: absolute;
                top: -20px;
                left: 50%;
                margin-left: -25px;
                width: 40px;
                height: 40px;
                border-radius: 100%;
                z-index: 1;
            }
            
            .mui-bar~.mui-pull-top-tips {
                top: 24px;
            }
            
            .mui-pull-top-wrapper {
                width: 42px;
                height: 42px;
                display: block;
                text-align: center;
                background-color: #efeff4;
                border: 1px solid #ddd;
                border-radius: 25px;
                background-clip: padding-box;
                box-shadow: 0 4px 10px #bbb;
                overflow: hidden;
            }
            
            .mui-pull-top-tips.mui-transitioning {
                -webkit-transition-duration: 200ms;
                transition-duration: 200ms;
            }
            
            .mui-pull-top-tips .mui-pull-loading {
                /*-webkit-backface-visibility: hidden;
                -webkit-transition-duration: 400ms;
                transition-duration: 400ms;*/
                margin: 0;
            }
            
            .mui-pull-top-wrapper .mui-icon,
            .mui-pull-top-wrapper .mui-spinner {
                margin-top: 7px;
            }
            
            .mui-pull-top-wrapper .mui-icon.mui-reverse {
                /*-webkit-transform: rotate(180deg) translateZ(0);*/
            }
            
            .mui-pull-bottom-tips {
                text-align: center;
                background-color: #efeff4;
                font-size: 15px;
                line-height: 40px;
                color: #777;
            }
            
            .mui-pull-top-canvas {
                overflow: hidden;
                background-color: #fafafa;
                border-radius: 40px;
                box-shadow: 0 4px 10px #bbb;
                width: 40px;
                height: 40px;
                margin: 0 auto;
            }
            
            .mui-pull-top-canvas canvas {
                width: 40px;
            }
            
            .mui-slider-indicator.mui-segmented-control {
                background-color: #efeff4;
            }
        </style>
    </head>
 
    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title">顶部选项卡-可左右拖动(webview)</h1>
        </header>
        <div class="mui-content">
            <div id="slider" class="mui-slider mui-fullscreen">
                <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
                    <div class="mui-scroll">
                        <a class="mui-control-item mui-active" href="#item1mobile" data-wid="tab-top-subpage-1.html">
                            推荐
                        </a>
                        <a class="mui-control-item" href="#item2mobile" data-wid="tab-top-subpage-2.html">
                            热点
                        </a>
                        <a class="mui-control-item" href="#item3mobile" data-wid="tab-top-subpage-3.html">
                            北京
                        </a>
                        <a class="mui-control-item" href="#item4mobile" data-wid="tab-top-subpage-4.html">
                            社会
                        </a>
                        <a class="mui-control-item" href="#item5mobile" data-wid="tab-top-subpage-5.html">
                            娱乐
                        </a>
                    </div>
                </div>
 
            </div>
        </div>
        <script src="../js/mui.min.js"></script>
        <script src="../js/webviewGroup.js" type="text/javascript" charset="utf-8"></script>
        <script>
            mui.init();
            
            mui.plusReady(function() {
                var _self = plus.webview.currentWebview();
                var group = new webviewGroup(_self.id, {
                    items: [{
                        id: "tab-top-subpage-1.html",
                        url: "tab-top-subpage-1.html",
                        extras: {}
                    }, {
                        id: "tab-top-subpage-2.html",
                        url: "tab-top-subpage-2.html",
                        extras: {}
                    }, {
                        id: "tab-top-subpage-3.html",
                        url: "tab-top-subpage-3.html",
                        extras: {}
                    }, {
                        id: "tab-top-subpage-4.html",
                        url: "tab-top-subpage-4.html",
                        extras: {}
                    }, {
                        id: "tab-top-subpage-5.html",
                        url: "tab-top-subpage-5.html",
                        extras: {}
                    }],
                    onChange: function(obj) {
                        var c = document.querySelector(".mui-control-item.mui-active");
                        if(c) {
                            c.classList.remove("mui-active");
                        }
                        var target = document.querySelector(".mui-scroll .mui-control-item:nth-child(" + (parseInt(obj.index) + 1) + ")");
                        target.classList.add("mui-active");
                        if(target.scrollIntoView) {
                            target.scrollIntoView();
                        }
                    }
                });
                mui(".mui-scroll").on("tap", ".mui-control-item", function(e) {
                    var wid = this.getAttribute("data-wid");
                    group.switchTab(wid);
                });
 
            });
            mui.back = function() {
                var _self = plus.webview.currentWebview();
                _self.close("auto");
            }
        </script>
    </body>
 
</html>