-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (95 loc) · 3.21 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no, email=no">
<title>山草油、推拿等产品展示</title>
<link rel="stylesheet" href="./css/style.css"/>
<link rel="stylesheet" href="css/animate.css">
<!--custom style-->
<style>
.current .title{
-webkit-animation: slideToTop .8s ease both;
}
.current .subtitle{
-webkit-animation: slideToTop .8s 0.3s ease both;
}
img{
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="page-wrap">
<div class="page">
<img src="./img/img (1).jpg" height="1280" width="950" alt="">
</div>
</div>
<script src="./js/zepto.min.js"></script>
<script src="./js/PageSlider.js"></script>
<script>
var all=9;
var promise = new Promise(function(resolve, reject) {
var tarFn=function(){
var box=$('.page-wrap');
var allEl="";
for(var i=1;i<all+1;i++){
var item="<div class='page'>"
+"<img src='./img/img ("+i+").jpg' height='1280' width='950' alt=''>"
+"</div>";
allEl+=item;
if(i==all){
box.html(allEl);
return true;
}
};
}
var result=tarFn();
console.log(result)
if (result){
resolve(true);
} else {
reject(false);
}
});
promise.then(function(data){
pagefn();
});
var pagefn=function(){
console.log('start')
var time;
var actShow=function(){
var e=$('.current').find('img');
var arr=["bounce","flash","pulse","rubberBand","shake","headShake","swing","tada","wobble","jello","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","flipInX","flipInYlightSpeedIn","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","hinge","rollIn","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp"];
function GetRandomNum(Min,Max)
{
var Range = Max - Min;
var Rand = Math.random();
return(Min + Math.round(Rand * Range));
}
var num = GetRandomNum(1,arr.length);
var randomAct=arr[num];
e.addClass('animated '+randomAct);
time=setTimeout(function(){
e.removeAttr('class')
},1500);
}
var p = new PageSlider({
pages: $('.page-wrap .page'),
onSwipeUp: function () {
var el=$('.current').find('img');
el.removeAttr('class');
clearTimeout(time);
},
onchange: function () {
actShow();
}
});
}
</script>
</body>
</html>