How do you implement animation functionality?



How do you implement animation functionality?..

Answer / chaitanya

The .animate() method allows us to create animation effects on any numeric CSS property. This method changes an element from one state to another with CSS styles. The CSS property value is changed gradually, to create an animated effect.

Syntax is:

Hide Copy Code

(selector).animate({styles},speed,easing,callback)

styles: Specifies one or more CSS properties/values to animate.

duration: Optional. Specifies the speed of the animation.

easing: Optional. Specifies the speed of the element in different points of the animation. Default value is "swing".

callback: Optional. A function to be executed after the animation completes.

Simple use of animate function is,

Hide Copy Code

$("btnClick").click(function(){

$("#dvBox").animate({height:"100px"});

});

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How to revert the most recent ‘destructive’ operation, changing the set of matched elements to its previous state using ?

0 Answers  


What is the advantage of using the minified version of jquery rather than using the conventional one?

0 Answers  


Is numeric in jquery?

0 Answers  


Explain .empty() vs .remove() vs .detach().

0 Answers  


How to divide a page into parts using jquery mobile? : jquery mobile

0 Answers  


Define the use of each function in jquery?

0 Answers  


How can we apply css in div using jquery?

0 Answers  


How to programmatically trigger a click event that's being handled by jquery?

0 Answers  


What is event.stoppropagation? : jquery mobile

0 Answers  


What is jquery.length? : jquery mobile

0 Answers  


What is the difference between size and length of jQuery?

0 Answers  


How to check or uncheck all checkboxes using jquery?

0 Answers  


Categories