How to make a parallax animation only inside a shape?

Is it possible to make a parallax animation only inside a shape?

I’m trying to make something like the images on this page (http://jessandruss.us/), where the image disappears when it moves outside the shape when scrolling.