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! While you're at it, check out some resources Treehouse students have shared here.

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

JavaScript

Kamran Ismayilov
Kamran Ismayilov
5,753 Points

How to do..

How can I accomplish exactly the same result on my webpage as you can swipe the photo on this site below: http://www.adme.ru/tvorchestvo-fotografy/kak-vyglyadit-devushka-v-13-primerochnyh-izvestnyh-magazinov-1225960/

Thanks in advance.

1 Answer

Steven Parker
Steven Parker
230,024 Points

Cute effect! There's two photos in a containing DIV that use absolute position so one is exactly on top of the other. Then, the width of the the one in front is adjusted by a JavaScript function that is reacting to mousemove events. The frontmost image has a right border that serves as the dividing line.

Get familiar with your browser's devtools and you'll be able to examine and analyze things you find around the web for yourself. If you use Chrome, there are some courses and workshops here.