Interface elements for jQuery - Documentation - Animate

Animate

Interface overwrites the default 'animate' function with an extended one. The new 'animate' function brings several enhancements:

Code sample:

$('#test').animate(
	{
		left: 100,
		style: 'padding: 20px 30px; margin: 10px;',
		className: 'greenBorders',
		opacity: 0.4,
		backgroundColor: 'olive'
	},
	'slow'
);

example

Also, Interface offfers new functions to handle animations:

stop

Stop an animation at any time.

Options:

gotolaststep Boolean optional Whatever to go to the last step in animation

Code sample:

$('#test').stop();

stopAll

Stop current animation and clear all queued animations.

Options:

gotolaststep Boolean optional Whatever to go to the last step in current animation

Code sample:

$('#test').stopAll();

pause

Add a pause between animations. The selection is not animated till the pausing time expires.

Options:

speed String|Number optional A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to pause (e.g. 1000).
callback Function optional A function to be executed whenever the pausing completes.

Code sample:

$('#test').pause(2000);

Download now

Interface 1.2 146kb (source files, compressed files)
jQuery 1.1.2 19 kb

MediaSecure