How to use the velocity-animate.defaults function in velocity-animate

To help you get started, we’ve selected a few velocity-animate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github julianshapiro / velocity / test / src / utilities.ts View on Github external
.velocity("stop");
	} catch {
		// We don't care if it fails.
	}
	// Free all targets requested by the current test.
	while (targets.length) {
		try {
			$qunitStage.removeChild(targets.pop());
		} catch {
			// We don't care if it fails.
		}
	}
	// Ensure we have reset the test counter.
	asyncTests();
	// Make sure Velocity goes back to defaults.
	Velocity.defaults.reset();
});
github julianshapiro / velocity / test / src / 2_Option / Option Fps Limit.ts View on Github external
testFrame = (frameRate) => {
			let counter = 0;

			Velocity.defaults.fpsLimit = frameRate;
			// Test if the frame rate is assigned succesfully.
			assert.equal(frameRate, Velocity.defaults.fpsLimit, "Setting global fps limit to " + frameRate);

			return Velocity($target, defaultProperties,
				{
					duration: 1000,
					progress() {
						counter++;
					},
				})
				.then(() => counter);
		};
github julianshapiro / velocity / test / src / 2_Option / Option Fps Limit.ts View on Github external
testFrame = (frameRate) => {
			let counter = 0;

			Velocity.defaults.fpsLimit = frameRate;
			// Test if the frame rate is assigned succesfully.
			assert.equal(frameRate, Velocity.defaults.fpsLimit, "Setting global fps limit to " + frameRate);

			return Velocity($target, defaultProperties,
				{
					duration: 1000,
					progress() {
						counter++;
					},
				})
				.then(() => counter);
		};
github julianshapiro / velocity / test / src / 2_Option / Option Speed.ts View on Github external
asyncTests(assert, 1, (done) => {
		Velocity.defaults.speed = 3;
		Velocity(getTarget(), defaultProperties, {
			speed: 5,
			begin(elements) {
				assert.equal(elements.velocity.animations[0].options.speed, 5, "Speed on options overrides default.");

				done();
			},
		});
	});