Parallax snippet

This 4 lines code gives you interesting effect. On mouse scroll it move .header_light back and forth. If you place the image with this class above similar image with slightly different contrast, color or anything else with little margin (towards top ~ 2-3 px), it should remind you something similar to 3D postcard (may be this is strange association). Make sure both images sit inside wrapper with position: absolute; (basically they would be on on another in two different layer with wrapper underneath).


$('body').mousemove (e)
amountMovedX = e.pageX * -1 / 100
$('.header_light').css 'background-position', amountMovedX + 'px '
return


In short, this is about:
#jquery

Start discussion:
Related articles: