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 |
Difference Between Prop and Attr in jQuery?
What are the guidelines for an application to follow the principles of progressive enhancement.
How to get/set the html contents of an element using jQuery?
How to search for descendant elements that match the specified selectors using ?
How to check/uncheck an input in jquery?
Explain event.preventdefault? : jquery mobile
What is the difference between find and children methods in jquery?
What are the methods used to provide effects in jquery?
How can we apply css in odd childs of parent node using jquery library?
Is it possible to hold or delay document.ready execution for sometime?
How do I check if an HTML element is empty using jQuery?
How to use connect in jquery?