DEV Community

loading...

Learn jQuery Animate method on Youtube

yogyogi
I am a programmer who is learning
・Updated on ・1 min read

The jQuery Animate method, as all of us know, is used to make great animation effect on web pages quite easily. It is also very easy to learn, hardly takes 15 minutes of your time.

Syntax

$(selector).animate({params},speed,callback)

Example

Let us see a simple example where I will be animating a square from left to right.

The code for this is:

$("#div1").animate({ left: '250px' });

Here 'div1' is the square, to whom you can provide any size or color using your normal CSS.

And when you run your web page, It will look like this:

alt text

Isn't this method great?
Let me know your thoughts.

Discussion (3)

Collapse
dance2die profile image
Sung M. Kim

Would you update the tag from #dotnet to "#jquery" and "#javascript"?

Collapse
yogyogi profile image
yogyogi Author • Edited

Yes sure, I did it now.

Collapse
dance2die profile image
Sung M. Kim

Thanks, @yogyogi
Hopefully people in need can find it easier~ πŸ‘‹