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 Use Ajax In Jquery?

0 Answers  


What is the slowest selector in jQuery?

0 Answers  


Explain the difference between .js and .min.js? : jquery mobile

0 Answers  


Can there be more than one ready function in jquery?

0 Answers  


Explain some benefits of jquery knockout?

0 Answers  






How to get the server response from an ajax request using jquery?

0 Answers  


With jquery which operating system is more compatible?

0 Answers  


What is the use of serialize method in jQuery?

0 Answers  


What is the use of jquery.data()?

0 Answers  


Differentiate between jquery.size and jquery.length? : jQuery Mobile

0 Answers  


Explain cdn in jquery?

0 Answers  


What are some of the ways to provide effects? : jQuery Mobile

0 Answers  


Categories