# Smooth Parallax Scrolling (CSS + JavaScript)

**URL:** <https://forum.kirupa.com/t/smooth-parallax-scrolling-css-javascript/636488>\
**Category:** Uncategorized\
**Created:** [April 24, 2017, 1:10pm UTC](https://forum.kirupa.com/t/smooth-parallax-scrolling-css-javascript/636488 "2017-04-24T13:10:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpoh](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jpoh](https://forum.kirupa.com/u/jpoh)\
**Post date:** [April 24, 2017, 1:10pm UTC](https://forum.kirupa.com/t/smooth-parallax-scrolling-css-javascript/636488/1 "2017-04-24T13:10:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [April 24, 2017, 5:12pm UTC](https://forum.kirupa.com/t/smooth-parallax-scrolling-css-javascript/636488/2 "2017-04-24T17:12:22Z")

</div>

jpoh - try the code here: [https://www.kirupa.com/html5/smooth\_parallax\_scrolling.htm](https://www.kirupa.com/html5/smooth_parallax_scrolling.htm)

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