[jump.js] Add option for passing duration as a function (#40082)

* Add option for passing duration as a function, it has been supported in jump.js just missing from typings https://github.com/callmecavs/jump.js/blob/master/src/jump.js#L133

* jump.js remove myself from the defitions by (also kick off another build)
This commit is contained in:
James Charlesworth
2019-11-05 11:15:34 -08:00
committed by Nathan Shively-Sanders
parent 2f8b27fdb0
commit 23332fa2c8
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ declare function jump(target: string | Element | number, opts?: jump.Options): v
declare namespace jump {
type TransitionFunc = (t: number, b: number, c: number, d: number) => number;
interface Options {
duration?: number;
duration?: number | ((distance: number) => number);
offset?: number;
callback?(): void;
easing?: TransitionFunc;
+3
View File
@@ -6,6 +6,9 @@ jump('.target');
jump('.target', {
duration: 1000,
});
jump('.target', {
duration: distance => Math.abs(distance)
});
jump('.target', {
duration: 200,
offset: 10