Smooth Parallax Scrolling (CSS + JavaScript)

I hv recreated ur code through the video, but I fail when it comes to the js part…

I cant bring it to work and also i do not understand how to read this line:
“translate3d{” + xPos + ", " + yPos + “px, 0”;

Why is the { in the quotations and what is generally wrong?

Thanks for help.

jpoh - try the code here: https://www.kirupa.com/html5/smooth_parallax_scrolling.htm

I’ll double check on the video and see why the code looks incorrect there :slight_smile:

1 Like