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 |
How to execute jQuery code after the DOM is ready?
Can we use our own specific character in the place of $ sign in jQuery?
How do you attach a event to element which should be executed only once?
How can we apply css in odd childs of parent node using jquery library?
What is the difference between text() and html() in jquery?
Tell me how to executed jquery selectors? : jquery mobile
Can you please explain the difference between .js and .min.js? : jquery mobile
Explain the starting point of code execution in jquery? : jquery mobile
How we can get the input value of an element using jquery?
How do you update ajax response with id " resilts"?
How to fetch the values of selected checkbox array using jquery?
explain width() vs css(‘width’) in jquery