Parallax with two layers when scrolling mouse

Asked

Viewed 66 times

0

I’m trying to do a two-layer Parallax and I’m not getting it.

What I want to do is similar to the site https://willianjusten.com.br/exemplos-de-sites-com-parallax/. I want the background image and title to scroll down at the same time and at different speeds to give the impression that the image is more in the background and the title a little further forward when scrolling the mouse down, and the reverse effect when scrolling the mouse up.

My problem is that I have no idea how to do in CSS3.

I have tried several examples like the site: https://keithclark.co.uk/articles/pure-css-parallax-websites/ but without the desired effect.

The HTML structure to receive Parallax looks like this:

HTML:

<div class="row parallax">
  <div class="col">
    <h1 class="text-center">text here</h1>
  </div>
</div>

<!-- restante do post -->
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

And the CSS:

.parallax{
   background:url('https://cdn.pixabay.com/photo/2017/12/23/22/12/orange-3036097_960_720.jpg');
   height:300px;
}
  • Brunão, but in the link you mentioned he already teaches everything... Here in this answer I even used a template of these Parallax with CSS where the guy wanted a light menu at the top... But the code of the Parallax is there only test or catch if you are interested https://answall.com/questions/235915/menu-fixo-no-parallax/259049#259049

  • So I think my browser is in trouble (Mozilla Linux) because it looks like its example from the other post: https://ibb.co/kHWxHK. The same happens with the attempts to do Parallax. Always something "Hold on"

  • Dude you have to check if these properties need prefix. Take all that CSS code from the other answer and paste it on the left side where it’s written. for example: https://autoprefixer.github.io/ ai the tool will put the prefixes of all browsers. But even so it may not work, ai you can check here which property your browser does not accept https://caniuse.com/#feat=transforms3d just type on top the property you want to search for

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.