InterviewSolution
Saved Bookmarks
| 1. |
Explain The Animate Function? |
|
Answer» The animate function is used to apply the custom animation effect to elements. Syntax: $(selector).animate({params}, [duration], [easing], [callback])
For example <div id id="clickToAnimate"> Click Me </div> <div id ="mydiv" style=”width:200px; height:300px; position: RELATIVE; right: 20px;"> </div>Following is the jQuery to animate opacity, left offset, and height of the mydiv element $('# clickToAnimate’).click(function() { $('#book').animate({ opacity: 0.30, left: '+=20', height: 'toggle' }, 3000, function() { // run after the animation complete. }); });The animate function is used to apply the custom animation effect to elements. Syntax: $(selector).animate({params}, [duration], [easing], [callback]) For example Following is the jQuery to animate opacity, left offset, and height of the mydiv element |
|