Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


boostr.in questions - Question:how to use jQuery Effects - Animation?


jQuery Animations - The animate() Method

The jQuery 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.

The optional speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is a function to be executed after the animation completes.

The following example demonstrates a simple use of the animate() method; it moves a

element to the left, until it has reached a left property of 250px:

Example

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

jQuery animate() - Manipulate Multiple Properties

Notice that multiple properties can be animated at the same time:

Example

$("button").click(function(){
  $("div").animate({
    left:'250px',
    opacity:'0.5',
    height:'150px',
    width:'150px'
  });
});

asked Sep 13, 2013 in jquery by rajesh
edited Sep 12, 2013
0 votes
9 views



Related Hot Questions



Government Jobs Opening


...