Skip to content

Commit

Permalink
* Tweaks and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joehewitt committed May 20, 2011
1 parent 966ed80 commit 6bc52fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
28 changes: 19 additions & 9 deletions examples/example1.html
Expand Up @@ -5,6 +5,8 @@
<title>Scrollability</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<style type="text/css">

html {
Expand All @@ -17,7 +19,7 @@
position: absolute;
left: 0;
top: 30px;
bottom: 0;
bottom: 30px;
width: 320px;
background: #fff;
overflow: hidden;
Expand All @@ -31,7 +33,7 @@
position: relative;
top: -1px;
border-top: 1px solid #ccc;
padding: 8px 12px;
padding: 9px 12px;
font: 21px Helvetica;
font-weight: bold;
background: #fff;
Expand All @@ -44,18 +46,25 @@
.bar {
position: absolute;
background: #222;
padding: 7px 0;
left: 0;
top: 0;
width: 100%;
color: #fff;
padding: 7px 0;
text-align: center;
font-size: 12px;
font-weight: bold;
text-align: center;
}

.bar.top {
top: 0;
border-bottom: 1px solid #000;
}

.item.touched {
.bar.bottom {
bottom: 0;
}

/*.item.touched {
color: #fff;
background: -webkit-gradient(
linear,
Expand All @@ -64,7 +73,7 @@
color-stop(0, #028AF3),
color-stop(1, #005DE6)
);
}
}*/

</style>

Expand Down Expand Up @@ -133,17 +142,18 @@
item.className = 'item';
item.innerHTML = names[i%names.length];
page.appendChild(item);
if (page.offsetHeight > container.offsetHeight*8) {
if (page.offsetHeight > container.offsetHeight*6) {
break;
}
}
});

</script>
</head>
<body>
<div class="bar top">Scrollability Demo</div>
<div class="bar bottom">Footer</div>
<div id="container">
<div id="page" class="scrollable vertical"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion scrollability-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions scrollability.js
Expand Up @@ -8,7 +8,7 @@ var kLockThreshold = 10;
var kTouchMultiplier = 1;

// Maximum velocity for motion after user releases finger
var kMaxVelocity = 1300;
var kMaxVelocity = 600;

// Rate of deceleration after user releases finger
var kDecelRate = 350;
Expand Down Expand Up @@ -410,8 +410,8 @@ function stopAnimation() {

function moveElement(element, x, y) {
element.style.webkitTransform = 'translate3d('
+(x ? (Math.round(x)+'px') : '0')+','
+(y ? (Math.round(y)+'px') : '0')+','
+(x ? (x+'px') : '0')+','
+(y ? (y+'px') : '0')+','
+'0)';
}

Expand Down

0 comments on commit 6bc52fe

Please sign in to comment.