Jump to content

How do I add this Parallax Effect to a Gallery?

Recommended Posts

Posted

Hey all!

 

I have this codepen that I think is really cool to show previous projects on my website https://codepen.io/thomassaulay/pen/XWJdORa

(currently I have a similar layout on my home page with a portfolio section but the images are static).

 

However when I use this codepen and refresh the website it doesn't create that parallax effect I'm looking for. 

Could someone help me achieve it? I have also put the css code in <style></style> and JS in <script> </script>

https://khaki-bumblebee-rgm8.squarespace.com/&nbsp;

website is live - no pass 

Thanks! 

 

  • Replies 1
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Posted

Squarespace - Codepen HTML uses a different HTML format, so to make code work, first you need to change your Squarespace section HTML, same as this format. If you can't do this, you can use Code Block > Copy - paste all code in HTML box

image.png.02edea1cbd0e13b83f818a80a1b16183.png

Next add code in CSS box to Custom CSS

With code in JS box, you need to use this code

<script src="https://cdnjs.cloudflare.com/ajax/libs/rellax/1.10.0/rellax.min.js"></script>
<script>
  // var scene = document.getElementById('hover-parallax');
// var parallaxInstance = new Parallax(scene);
// parallaxInstance.friction(0.8, 0.8);

// Parallax on scroll. From -10 to +10.
var rellax = new Rellax('.rellax');



</script>

image.thumb.png.ca6f81f553dafaab17ce594537bebdf1.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.