Вот тестовое изображение моего сайта. В настоящее время блок сверху увеличивается по мере прокрутки экрана вниз, но он идет сверху. Как мне заставить его подняться снизу? Это связано со смещением? div
называется stem
, а нижний div
называется timeline
.

function showStem() {
var stemb = $(".stem-background");
var stem = $(".stem");
var timeline = $(".timeline");
var timelineot = timeline.offset().top;
var h = document.documentElement.clientHeight;
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > timelineot - h) {
stemb.hide();
stem.show();
stem.height(scroll + h - timelineot);
} else {
stemb.hide();
stem.hide();
}
});
}
.timeline {
background: #112C30;
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 15px;
line-height: 26px;
color: #B9CFD0;
overflow: hidden;
}
.timeline a {
color: #B9CFD0;
text-decoration: none;
border-bottom: 1px solid #B9CFD0;
}
.timeline h1, h2, h3, h4, h5, h6 {
font-family: 'Comfortaa', cursive;
}
.main-content {
margin: 0 auto;
position: relative;
}
.main-content .section-inner, .main-content .post-wrapper {
*zoom: 1;
}
.main-content .section-inner:before, .main-content .section-inner:after, .main-content .post-wrapper:before, .main-content .post-wrapper:after {
content: "";
display: table;
}
.main-content .section-inner:after, .main-content .post-wrapper:after {
clear: both;
}
.section .section-inner {
margin: 0 auto;
width: 1024px;
}
@media only screen {
.section .section-inner {
width: auto;
max-width: 1024px;
}
}
.stem-wrapper {
position: fixed;
top: 0;
bottom: 0;
left: 50%;
z-index: auto;
}
.stem-wrapper.color-yellow .stem-background {
background: #E9E566;
}
.stem-wrapper.color-green .stem-background {
background: #35C189;
}
.stem-wrapper.color-white .stem-background {
background: #FFF;
}
.stem-wrapper .stem, .stem-wrapper .stem-background {
position: absolute;
top: 0;
left: -30px;
width: 60px;
}
.stem-wrapper .stem{
background: #1e4f56;
overflow: hidden;
height: 100%;
}
.stem-wrapper .stem-background {
background: #ecf6f9;
height: 50%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="timeline">
<div class="stem-wrapper">
<div class="stem"></div>
<div class="stem-background"></div>
</div>
<!-- more content -->
</div>
Я пробовал несколько вещей в CSS, но многие из них переполнены.