I have got a fixed navigation sidebar and want to use transitions for slide-up/slide-down animations on the sublevels. For some unknown reason Chrome is scrolling the page while animating. Because this happens only in Chrome, it might be a bug. Does someone know what goes wrong?
html,body {
margin: 0;
padding: 0;
color: white;
}
#content {
position: relative;
height: 4000px;
overflow: auto;
background: grey;
}
#fixed {
position: fixed;
right: 0;
top: 0;
height: 100vh;
width: 200px;
background: red;
overflow-x: hidden
overflow-y: auto;
}
#test {
max-height: 0;
background: blue;
transition: max-height 0.5s, padding-bottom 0.5s;
overflow: hidden;
}
#test:target {
max-height: 50vh;
}
#testContent {
height: 200px;
background: green;
}
<div id="content">
<div id="fixed">
<a href="#test">Open Test</a><br/>
<a href="#">Close Test</a><br/>
<div id="test">
<div id="testContent"></div>
</div>
</div>
</div>
To the poor souls who have suffered without an answer to this, as have I, for the past 5 years... my gift to you:
overflow-anchor: none
Adding it to a parent/wrapper container seems to have done the trick for me. More details on the property here: https://css-tricks.com/almanac/properties/o/overflow-anchor/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With