Skip to content

Commit 7abfe76

Browse files
committed
calculate default duration based on distance instead of start position
1 parent 5837e82 commit 7abfe76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elevator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var Elevator = function(options) {
111111

112112
// No custom duration set, so we travel at pixels per millisecond. (0.75px per ms)
113113
if( !customDuration ) {
114-
duration = (startPosition * 1.5);
114+
duration = ( Math.abs(endPosition - startPosition) * 1.5);
115115
}
116116

117117
requestAnimationFrame( animateLoop );

0 commit comments

Comments
 (0)