1
Well I do not know even ask and name as is the name of this feature, something similar to the site of Airbnb when the right side card reaches the top of the page it stays fixed moving only the middle page content.
How to do something like this ?
I even found this answer @6153074 but this is disappearing in my case I can not give fadeIn
or fadeOut
I’m not getting it, look at you.
.banner-full {
img {
width: 99vw !important;
height: 70vh !important;
}
.cardContact {
height: 500px;
background-color: red;
width: 400px;
position: sticky;
top: 900px; /* distancia que o elemento vai parar antes do topo */
}
}
<div class="banner-full">
<img src="https://picsum.photos/1585/552/?random" alt="">
<div class="row">
<div class="col m6" style="height: 3000px">
</div>
<div class="col m6">
<div class="cardContact">
</div>
</div>
</div>
</div>
It is appearing this way in Chrome Devtools:
It defines the div with "position:Fixed", when the "scroll" reaches the top of that div
– Marcos Brinner
Read about: position Sticky
– Wallace Maxters
@Wallacemaxters, yes but remembering that Sticky position is not supported by all browsers yet, so actually mostly old versions like Chrome, if he wants something crossbrowser it would be better to use Fixed position and javascript >> https://caniuse.com/#feat=css-Sticky here is a list of supported browsers[
– Marcos Brinner
@Marcosbrinner actually just doesn’t work on IE... so I would say that support serves 95% of browsers....
– hugocsl
Thank you very much, if anyone wants to formulate an answer for me to accept, feel free.
– Renan Rodrigues
You wrote the CSS in SCSS is that right? You are using Bootstrap?
– hugocsl
Oops. I’m using materialize.
– Renan Rodrigues