Q: Mousewheel - Cross scroll inside two different divs I created two content fields. In this area, I am trying to scroll the left content up and the right content down with the mouse wheel. I couldn't make it independent from page scroll. When the general page (behind page) scroll is finished, scrolling stops for aaa and bbb. can i do this any other way


$(document).ready(function(){
    let screenHeighter = $(window).innerHeight();
    let scrollReset = $(window).scrollTop();
    let scLeftHeight = $(".bbb")[0].scrollHeight;
    let scRightHeight = $(".ccc")[0].scrollHeight;
    let scrollElement = $(".ccc-scroller");
    let scrollElementX = $(".bbb-scroller");
    let defLeftTop = ((scLeftHeight - screenHeighter) / 2) + 100;
    let defRightTop = ((scRightHeight - screenHeighter) / 2) - 100;
    scrollElement.css({"transform": "translate3d(0px, -" + defRightTop + "px, 0px)"});
    scrollElementX.css({"transform": "translate3d(0px, -" + defLeftTop + "px, 0px)"});
    $('.aaa').on('mousewheel', function(e){
        let logger = console.log();
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            let scrollX = scrollReset;
            let scrollPos = (scroll - scrollX) - defRightTop;
            let scrollPosX = ((scroll - scrollX) + defLeftTop) * -1;
            if (scrollPos < 0 && (scrollPos * -1) < (scRightHeight - screenHeighter)) {
                scrollElement.css({"transform": "translate3d(0px, " + scrollPos + "px, 0px)"});
            }
            if (scrollPosX < 0 && (scrollPosX * -1) < (scRightHeight - screenHeighter)) {
                scrollElementX.css({"transform": "translate3d(0px, " + scrollPosX + "px, 0px)"});
            }
        });
    });
})
.aaa {
  position:fixed;
  top:0;
  height:100%;
  width:100%;
  background:#222;
  color:#fff;
}
.bbb {
  position:absolute;
  top:0;
  left:0;
  width:50%;
  height:100%;
  border-right:1px solid rgba(255,255,2550.1);
}
.ccc {
  position:absolute;
  top:0;
  height:100%;
  right:0;
  width:50%;
  border-right:1px solid rgba(255,255,2550.1);
}
.ccc-scroller {
  position:relative;
  overflow:hidden;
}
.bbb-scroller {
  position:relative;
  overflow:hidden;
}
.package {
  padding:50px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="aaa">
    <div class="bbb">
        <div class="bbb-scroller">
            <div class="package">
               Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
            <div class="package">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
            <div class="package">
               Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
        </div>
    </div>
    <div class="ccc">
        <div class="ccc-scroller">
            <div class="package">
               Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
            <div class="package">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
            <div class="package">
               Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
        </div>
    </div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>


