-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
160 lines (117 loc) · 3.57 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
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ant</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="css/swiper.min.css">
<script src="js/jquery-1.10.1.min.js"></script>
<script src="js/swiper.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
#banner {
width: 100%;
height:100%;
overflow: hidden;
position:relative;
}
#banner .swiper-slide {
position:relative;
text-align:center;
}
#banner img {
max-width: 100%;
}
.pagination {
position: absolute;
z-index: 20;
bottom: 10px;
width: 60px;
/* text-align: center;*/
right:50%;
}
</style>
</head>
<body>
<div id="banner">
<div class="swiper-wrapper">
<div class="swiper-slide"><img src="images/2.jpg" /></div>
<div class="swiper-slide"><img src="images/1.jpg" /></div>
<div class="swiper-slide"><img src="images/3.jpg" /></div>
</div>
<div class="pagination"></div>
</div>
<script type="text/javascript">
window.onload = function() {
var mySwiper = new Swiper('#banner',{
iOSEdgeSwipeDetection:true,
iOSEdgeSwipeThreshold:50,
autoplay:5000,
visibilityFullFit:true,
loop:true,
pagination : '.pagination',
paginationClickable :true,
});
}
</script>
调用APP IOS
<br />
<a href="weixin:">打开手机微信</a>
<a href="weibo:">打开微博</a>
<a href="Dianping:">打开大众点评</a>
<a href="mqq:">打开QQ</a>
<br /> <br />
没安装
<br />
<a onClick="javascript:try_to_open_app();" href="Newsapp:">打开网易新闻 </a> <!--先执行onclick -->
</div>
<script type="text/javascript">
/*
* 辨别手机浏览器版本信息:
*
*/
var browser = {
versions: function() {
var u = navigator.userAgent, app = navigator.appVersion;
return {
//移动终端浏览器版本信息
trident: u.indexOf('Trident') > -1, //IE内核
presto: u.indexOf('Presto') > -1, //opera内核
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
iPad: u.indexOf('iPad') > -1, //是否iPad
webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
};
}(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
}
/*
document.writeln("语言版本: " + browser.language);
document.writeln(" 是否为移动终端: " + browser.versions.mobile);
document.writeln(" ios终端: " + browser.versions.ios);
document.writeln(" android终端: " + browser.versions.android);
document.writeln(" 是否为iPhone: " + browser.versions.iPhone);
document.writeln(" 是否iPad: " + browser.versions.iPad);
document.writeln(navigator.userAgent);
*/
var timeout;
function open_appstore(){
if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
window.location='itms-apps://itunes.apple.com/us/app/wang-yi-xin-wen/id425349261?mt=8';
}else if (browser.versions.android){
window.location="http://file.ws.126.net/3g/client/netease_newsreader_android.apk";
}
}
function try_to_open_app(){
timeout = setTimeout('open_appstore()', 300);
}
</script>
</body>
</html>