forked from cubiq/iscroll
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: src/iscroll.js
- Loading branch information
Showing
18 changed files
with
1,928 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,10 @@ | ||
iScroll v4.0 dev. rel. | ||
iScroll v4.0 Beta 2 | ||
====================== | ||
|
||
Please note that this is a *development release* not ready for production. I'm making this public to receive your feedback and bug fixes. If you are looking for a stable version please check [my blog](http://cubiq.org/iscroll). | ||
Please note that this is a *Beta version*. I'm making this public to receive your feedback and bug fixes. If you are looking for a stable version please check [my blog](http://cubiq.org/iscroll). | ||
|
||
At the moment the priority is to have the basic scroller as solid as possible, especially on Android. Scrolling seems now extremely smooth on Android (2.1/2.2), please test it on your device and let me know. | ||
|
||
## About | ||
|
||
The overflow:scroll for mobile webkit. Project started because webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div. So basically it was impossible to have a fixed header/footer and a scrolling central area. Until now. | ||
|
||
## License | ||
|
||
This software is released under the MIT License. | ||
|
||
Copyright (c) 2010 Matteo Spinelli, http://cubiq.org/ | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
java -jar /usr/local/bin/yuicompressor-2.4.2.jar -v --charset utf-8 ../src/iscroll.js -o ../dist/iscroll-min.js | ||
java -jar /usr/local/bin/yuicompressor-2.4.2.jar -v --charset utf-8 ../src/iscroll-lite.js -o ../dist/iscroll-lite-min.js |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
<title>iScroll demo: Carousel</title> | ||
|
||
<script type="text/javascript" src="../../src/iscroll.js?v4"></script> | ||
|
||
<script type="text/javascript"> | ||
var myScroll; | ||
|
||
function loaded() { | ||
myScroll = new iScroll('wrapper', { | ||
snap: true, | ||
momentum: false, | ||
hScrollbar: false, | ||
onScrollEnd: function () { | ||
document.querySelector('#indicator > li.active').className = ''; | ||
document.querySelector('#indicator > li:nth-child(' + (this.currPageX+1) + ')').className = 'active'; | ||
} | ||
}); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', loaded, false); | ||
</script> | ||
|
||
<style type="text/css" media="all"> | ||
body,ul,li { | ||
padding:10px; | ||
margin:0; | ||
} | ||
|
||
body { | ||
font-size:12px; | ||
-webkit-user-select:none; | ||
-webkit-text-size-adjust:none; | ||
font-family:helvetica; | ||
} | ||
|
||
#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); | ||
} | ||
|
||
#wrapper { | ||
width:300px; | ||
height:160px; | ||
|
||
float:left; | ||
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. */ | ||
overflow:hidden; | ||
|
||
background:#aaa; | ||
-webkit-border-radius:10px; | ||
background:#e3e3e3; | ||
} | ||
|
||
#scroller { | ||
width:2100px; | ||
height:100%; | ||
float:left; | ||
padding:0; | ||
} | ||
|
||
#scroller ul { | ||
list-style:none; | ||
display:block; | ||
float:left; | ||
width:100%; | ||
height:100%; | ||
padding:0; | ||
margin:0; | ||
text-align:left; | ||
} | ||
|
||
#scroller li { | ||
-webkit-box-sizing:border-box; | ||
display:block; float:left; | ||
width:300px; height:160px; | ||
text-align:center; | ||
font-family:georgia; | ||
font-size:18px; | ||
line-height:140%; | ||
} | ||
|
||
#nav { | ||
width:300px; | ||
float:left; | ||
} | ||
|
||
#prev, #next { | ||
float:left; | ||
font-weight:bold; | ||
font-size:14px; | ||
padding:5px 0; | ||
width:80px; | ||
} | ||
|
||
#next { | ||
float:right; | ||
text-align:right; | ||
} | ||
|
||
#indicator, #indicator > li { | ||
display:block; float:left; | ||
list-style:none; | ||
padding:0; margin:0; | ||
} | ||
|
||
#indicator { | ||
width:110px; | ||
padding:12px 0 0 30px; | ||
} | ||
|
||
#indicator > li { | ||
text-indent:-9999em; | ||
width:8px; height:8px; | ||
-webkit-border-radius:4px; | ||
background:#ddd; | ||
overflow:hidden; | ||
margin-right:4px; | ||
} | ||
|
||
#indicator > li.active { | ||
background:#888; | ||
} | ||
|
||
#indicator > li:last-child { | ||
margin:0; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="wrapper"> | ||
<div id="scroller"> | ||
<ul id="thelist"> | ||
<li><strong>1.</strong> <em>A robot may not injure a human being or, through inaction, allow a human being to come to harm.</em></li> | ||
<li><strong>2.</strong> <em>A robot must obey any orders given to it by human beings, except where such orders would conflict with the First Law.</em></li> | ||
<li><strong>3.</strong> <em>A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.</em></li> | ||
<li><strong>Zeroth Law:</strong> <em>A robot may not harm humanity, or, by inaction, allow humanity to come to harm.</em></li> | ||
<li><strong>Lyuben Dilov's Forth law:</strong> <em>A robot must establish its identity as a robot in all cases.</em></li> | ||
<li><strong>Harry Harrison's Forth law:</strong> <em>A robot must reproduce. As long as such reproduction does not interfere with the First or Second or Third Law.</em></li> | ||
<li><strong>Nikola Kesarovski's Fifth law:</strong> <em>A robot must know it is a robot.</em></li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div id="nav"> | ||
<div id="prev" onclick="myScroll.scrollToPage('prev', 0);return false">← prev</div> | ||
<ul id="indicator"> | ||
<li class="active">1</li> | ||
<li>2</li> | ||
<li>3</li> | ||
<li>4</li> | ||
<li>5</li> | ||
<li>6</li> | ||
<li>7</li> | ||
</ul> | ||
<div id="next" onclick="myScroll.scrollToPage('next', 0);return false">next →</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.