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

Differences Between jQuery .bind() and .live()?

1 Answers  


What is event.PreventDefault in jQuery?

1 Answers  


How do I check if the DOM is ready?

1 Answers  


What is a jquery ajax?

1 Answers  


How to disable cut,copy and paste in TextBox using jQuery?

1 Answers  


Is it possible to get value of multiple CSS properties in single statement?

1 Answers  


Tell me do I need to add the jquery file both at the master page and content page as well?

1 Answers  


What are the different types of selectors?

1 Answers  


What features of jquery, has been used in web applications?

1 Answers  


What are the paremeter of jquery ajax method?

1 Answers  


Can you please explain the difference between body onload() and document.ready() function? : jquery mobile

1 Answers  


Need to add jQuery file in both Master and Content page?

1 Answers  


Categories