Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

O─čulcan Girginc
O─čulcan Girginc
24,848 Points

The New MacBook animation!

Does anyone have any idea how to do an animation like this?

1 Answer

Jesus Mendoza
Jesus Mendoza
23,287 Points

It can be done with keyframes or jQuery (.show() / .fadeIn()) but I think they're using jQuery in this case

O─čulcan Girginc
O─čulcan Girginc
24,848 Points

I didn't know jQuery was this powerful. Thanks! :)

Jesus Mendoza
Jesus Mendoza
23,287 Points

You can also do it with keyframes, check it out http://codepen.io/Jesusz0r/full/WbgLxK/

I'm not an expert in animations, so, I don't know if how I did it is ok!

O─čulcan Girginc
O─čulcan Girginc
24,848 Points

It's nice but I think, it must be very difficult to do it with a picture. That MacBook opening, when scrolling down just hypnotises me! :D

O─čulcan Girginc
O─čulcan Girginc
24,848 Points

They changed the animation with a picture! :/ I wish I had taken a video of it... :(

Jesus Mendoza
Jesus Mendoza
23,287 Points

I thought you meant the fade in effect hahaha I didn't see the mac opening

O─čulcan Girginc
O─čulcan Girginc
24,848 Points

It was the most beautiful animation I have ever seen! That macbook was closed and it was opening when you were scrolling down. Don't know why they changed it with a simple picture! :/

Jesus Mendoza
Jesus Mendoza
23,287 Points

They probably had troubles with cross browser support