jQuery Animate

Custom animations.

jQuery Animate

The animate() method is used to create custom animations.

Syntax

$(selector).animate({params}, speed, callback);

The required params parameter defines the CSS properties to be animated.

Note: By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!

Example

$("button").click(function(){
  $("div").animate({left: '250px'});
});