0

I have a parallax / swipe effect that I am trying to achieve by attaching fixed background images to containers that are animating left and right, but I also need the ability to have the image scroll vertically with the page. How can achieve this visual effect while allowing vertical scroll?

.project-ten__container {
 position: relative;
 display: inline-block;
 width: 20vw;
 height: 100vh;
 vertical-align: top;
 background-attachment: fixed;
 background-position: center;
 background-repeat: no-repeat;
 overflow: hidden;
 }

Make sure to mouseover the elements in the jFiddle to get the parallax / swipe effect, and scroll down on the jfiddle to see the problem https://jsfiddle.net/pd37cmey/2/

2
  • Do you want to make the color grid to behave horizontal or you just want to show the images all the time during vertical scroll ? Commented Jun 18, 2016 at 6:09
  • i want the images to move with the page when you scroll vertically, not stay fixed to their current position Commented Jun 18, 2016 at 6:24

1 Answer 1

1
.project-ten__container {
    position: relative;
    left: -10%;
    display: inline-block;
    width: 20vw;
    height: 100vh;
    vertical-align: top;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-background-size: 30%;
    -moz-background-size: 30%;
    background-size: 30%;
    overflow: hidden;
    -webkit-transition: opacity 0.1s ease;
    transition: opacity 0.1s ease;
  }

https://jsfiddle.net/manishghec/0c6q05yu/3/

However this took me around an hour :).

Thanks !!

Sign up to request clarification or add additional context in comments.

1 Comment

I think this is due to jsFiddle run screen alignment issue. Let's try this on original code and check if this is working fine. Thanks !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.