0
body{
background: #000;
display: flex;
flex: 1;
flex-direction: column;
height: 300vh;
justify-content: center;
align-items: center;
}
p{
color: white;
}
.navegacao-lateral{
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex: 1;
flex-direction: column;
justify-content: space-around;
height: 100vh;
border-style: solid;
border-width: 0 1px 0 0;
border-color: #fff;
padding: 0 3vw;
}
#tela1{
display: flex;
flex: 1;
height: 100vh;
justify-content: center;
align-items: center;
}
#tela2{
display: flex;
flex: 1;
height: 100vh;
justify-content: center;
align-items: center;
}
#tela3{
display: flex;
flex: 1;
height: 100vh;
justify-content: center;
align-items: center;
}
.marca{
position: fixed;
top: 16%;
left: 13%;
width: 10px;
height: 10px;
background: red;
}
<nav class="navegacao-lateral">
<a href="#tela1"> Tela 1 </a>
<a href="#tela2"> Tela 2 </a>
<a href="#tela3"> Tela 3 </a>
</nav>
<div class="marca">
</div>
<div id="tela1" >
<p>
tela1
</p>
</div>
<div id="tela2" >
<p>
tela2
</p>
</div>
<div id="tela3" >
<p>
tela3
</p>
</div>
https://jsfiddle.net/nsLp2frw/4/
follows this html, css code a page on Onepage with 3 pages inside, a side navbar for navigate enter screens 1 2 and 3, have a red dot on the link side from the navigation, I want it to walk to the link of the screen that it "navigated"
basically I want the red dot to indicate which screen the user is currently on, or at which point of "body" the screen is focusing.
How do you do that? what name for that effect ?
Ixi maria! Óia the guy is learning JS :P :D
– Sam
@Sam here the stuff is Oko! I told you I was going to learn rss, but I’m still just a "young apprentice". It was worth the force
– hugocsl
top, congratulations on the solution
– user148170
well cool, I learned a new stop rs, but still yes if the user scrolls the page the point will not move to the next link. i thought of something like, take the size of the document and move the point with a percentage equal to the scrolling the user does. possible ?
– leonardo vita
Thanks my dear @Leandroalfredo
– hugocsl
@leonardovita guy this change in scrolling (besides tb change in click), what I suggest to you is to use the
Intersection Observer
, so when Tela2 enters the screen for example, you likewise foreach and place the class in Link2, with theIntersection Observer
, vc don’t need to be calculating screen height etc. But that would be subject to another question, and to another reply tb rss– hugocsl
vlw Ugo! I help a lot
– leonardo vita