Skip to content

Commit

Permalink
Updated dist
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy1978 committed Aug 18, 2012
1 parent d8ceb24 commit 0d35b79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions dist/jquery.scrollz.js
Expand Up @@ -495,17 +495,16 @@
var previousTouchTime = _getTrackingData(instance, 'previousTouchTime');
var duration = new Date() - previousTouchTime;
var distance = previousTouchY - lastTouchY;
var speed = Math.abs(distance / duration);
var acceleration = Math.abs(distance / duration);

// Inertia move (with speed threshold)
if (settings.inertia && (speed > 0.50)) {
var offset = (Math.pow(speed, 2) * Math.abs(distance)) * 1.25;
if (settings.inertia) {
var offset = Math.pow(acceleration, 2) * 750;
if (distance < 0) {
offset *= -1;
}

container.stop(true, true);
container.animate({scrollTop: _fixContainerScrollTopBounds(instance, container.scrollTop() + offset)}, {duration: speed * 500, easing : 'easeOutCubic'});
container.animate({scrollTop: _fixContainerScrollTopBounds(instance, container.scrollTop() + offset)}, {duration: acceleration * 750, easing : 'easeOutCubic'});
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.scrollz.min.js

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

2 changes: 0 additions & 2 deletions src/jquery.scrollz.js
Expand Up @@ -493,13 +493,11 @@
var distance = previousTouchY - lastTouchY;
var acceleration = Math.abs(distance / duration);

console.log('acceleration = ' + acceleration + ' dist = ' + distance);
if (settings.inertia) {
var offset = Math.pow(acceleration, 2) * 750;
if (distance < 0) {
offset *= -1;
}
console.log('off =' + offset);

container.stop(true, true);
container.animate({scrollTop: _fixContainerScrollTopBounds(instance, container.scrollTop() + offset)}, {duration: acceleration * 750, easing : 'easeOutCubic'});
Expand Down

0 comments on commit 0d35b79

Please sign in to comment.