My favorites | Sign in
Project Home Downloads Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 45 attachment: test.html (5.3 KB)

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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<title>iPhone UI</title>


<link rel="stylesheet" type="text/css" href="jqtouch/jqtouch.css">
<script type="text/javascript" src="iscroll.js"></script>
<script src="jqtouch/jquery.js"></script>
<script src="jqtouch/jqtouch.js"></script>


<script type="text/javascript">
$.jQTouch();
var myScroll;
var a = 0;
function loaded() {
setHeight(); // Set the wrapper height. Not strictly needed, see setHeight() function below.

// Please note that the following is the only line needed by iScroll to work. Everything else here is to make this demo fancier.
myScroll = new iScroll('scroller', {desktopCompatibility:true});
}

// Change wrapper height based on device orientation. Not strictly needed by iScroll, you may also use pure CSS techniques.
function setHeight() {
var headerH = document.getElementById('header').offsetHeight,
footerH = document.getElementById('footer').offsetHeight,
wrapperH = window.innerHeight - headerH - footerH;
document.getElementById('wrapper').style.height = wrapperH + 'px';
}

// Check screen size on orientation change
window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', setHeight, false);

// Prevent the whole screen to scroll when dragging elements outside of the scroller (ie:header/footer).
// If you want to use iScroll in a portion of the screen and still be able to use the native scrolling, do *not* preventDefault on touchmove.
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

// Load iScroll when DOM content is ready.
document.addEventListener('DOMContentLoaded', loaded, false);
</script>

<style type="text/css" media="all">
body,ul,li {
padding:0;
margin:0;
border:0;
}

body {

-webkit-user-select:none;
-webkit-text-size-adjust:none;

/* padding-bottom:44px; /* This prevents the scroller to lock if the user swipes down outside of the screen.
NOT needed if in home screen mode and on Android. */
}

body {
font-size:12px;
-webkit-user-select:none;
-webkit-text-size-adjust:none;
/* -webkit-box-sizing:border-box;*/
font-family:helvetica;
/* padding-bottom:44px; /* This prevents the scroller to lock if the user swipes down outside of the screen.
NOT needed if in home screen mode. */
}

#header {
width:100%;
height:45px;
line-height:45px;
background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fe96c9), color-stop(0.05, #d51875), color-stop(1, #7b0a2e));
padding:0;
color:#eee;
font-size:20px;
text-align:center;
}

#header a {
color:#f3f3f3;
text-decoration:none;
font-weight:bold;
text-shadow:0 -1px 0 rgba(0,0,0,0.5);
}

#footer {
width:100%;
height:48px;
background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #999), color-stop(0.02, #666), color-stop(1, #222));;
padding:0;
border-top:1px solid #444;
}

#footer li {
display:block;
float:left;
}

#footer li {
width:50%;
text-align:center;
}

#footer a.remove {
border-right:1px solid #333;
}

#footer a.add {
border-left:1px solid #6a6a6a;
}

#footer a {
display:block;
text-decoration:none;
font-size:12px;
color:#eee;
line-height:24px;
text-shadow:0 -1px 0 #000;
}

#footer span {
display:block;
font-size:30px;
font-weight:bold;
}

#wrapper {
height:200px; /* Of course you need to specify the object height */

position:relative; /* On older OS versions "position" and "z-index" must be defined, */
z-index:1; /* it seems that recent webkit is less picky and works anyway. */

width:100%;
background:#aaa;
overflow:hidden;
/* background:#aaa url(wrapper-bg.png);*/
}

#scroller {
/* -webkit-touch-callout:none;*/
/* -webkit-tap-highlight-color:rgba(0,0,0,0);*/

float:left;
width:100%;
padding:0;

/* -webkit-box-shadow:0 0 8px #555; /* Don't use shadows in production, they slow down drastically CSS animations */
}



#scroller li {
padding:0 10px;
height:40px;
line-height:40px;
border-bottom:1px solid #ccc;
border-top:1px solid #fff;
background-color:#fafafa;
/* background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#d4d4d4), to(#fafafa));*/
font-size:14px;
}

</style>
</head>
<body>
<div id="header">
</div>
<div id="jqt">
<div id="home" class="current transitions">
<div id="wrapper">
<div id="scroller">
<div id="thelist">
<ul class="edgetoedge">
<li><a href="#page1" class="slide">Link</a></li>
<li>Pretty content row 3</li>
<li>Pretty content row 4</li>
<li>Pretty content row 5</li>
<li>Pretty content row 6</li>
<li>Pretty content row 7</li>
<li>Pretty content row 8</li>

<li>Pretty content row 9</li>
<li>Pretty content row 10</li>
<li>Pretty content row 11</li>
<li>Pretty content row 12</li>
<li>Pretty content row 13</li>
<li>Pretty content row 14</li>

<li>Pretty content row 15</li>
<li>Pretty content row 16</li>
<li>Pretty content row 17</li>
<li>Pretty content row 18</li>
<li>Pretty content row 19</li>
</ul>
</div>
</div>
</div>
</div>

<div id="page1">
<ul>
<a href="#" class="back">back</a>
</ul>
</div>
</div>

<div id="footer"></div>

</body>
</html>

Powered by Google Project Hosting