Troubleshoot and resolve the issue of a page scroll freeze bug occurring while scrolling through an overflowed

My webpage features a Hero section with 2 columns - the left column contains a gallery slider, and the right column consists of 2 text blocks. The challenge here is that the right column needs to be 100% of the screen height while scrolling. To achieve this, I set a fixed height for the hero section and added overflow-y: auto. An interesting design requirement is that when you scroll while hovering over the left column, the text in the right column should scroll down to reveal a callout button at the bottom before continuing to scroll down the page. I initially tried aligning the columns using flex but encountered issues with making the left column sticky, so I switched to floated elements. However, I faced a problem where once I reach the bottom of the Hero section, I can't further scroll down the page unless I move my mouse, which seems to unlock the scrolling feature. I attempted various JavaScript solutions, like triggering auto-scrolling down upon reaching the bottom of the section, but nothing worked. I searched extensively online for a solution but couldn't find one. Does anyone have any suggestions?

.hero-header {
    height: 100vh;
    overflow-y: auto;
}
(hero header styles continue...)
(preformatted CSS/HTML code follows...)

Answer №1

I have made some modifications to your code in the .hero-header container and right sidebar (.main-wrapper). Please review the changes.

.hero-header {
    height: 100vh;
    /* overflow-y: auto; */
    overflow: hidden;
}
.hero-header:after{
    content: '';
    display: table;
    clear: both;
    width: 100%;
}
.main-slider {
    max-width: 63%;
    width: 63%;
    float: left;
    position: sticky;
    top: 0;
}
.slide{
color: green;
font-weight: 700px;
text-align: center;
}
.main-slider_arrow{
  cursor: pointer;
      position: absolute;
      z-index: 10;
      visibility: hidden;
      top: 37vh;
}
#hero-prev{
  left: 20px;
}
#hero-next{
  right: 20px;
}
.main-wrapper {
    max-width: 37%;
    width: 37%;
    float: right;
    /* try this */
    height: 100%;
    overflow: auto;
}

.slider-gallery .slide {
    padding: 8px;
    height: calc(100vh - 61px);
    position: relative;
    margin-top: 61px;
    @media screen and (max-width: 1024px) {
      margin-top: unset;
    }
}

.highlight-box{
height: 545px;
    background-color: #da0f0d;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 102px;
    color: white;
    
}
.text-container{
  margin-bottom: 20px;
}

.section{
  text-align: center;
  background: skyblue;
  padding: 80px 100px;
  min-height: 700px;
}
<div class="hero-header">
    <div class="main-slider">
        <div class="main-slider_arrow" id="hero-prev">
            Prev
        </div>
        <div class="slider-col">
            <div class="slider-gallery">
                <div class="slide">
                   #slide1
                </div>
            </div>
        </div>

        <div class="main-slider_arrow" id="hero-next">
            Next
        </div>
    </div>

    <div class="main-wrapper">
        <div class="highlight-box">
          <div class="highlight-box_heading">Title</div>
          <div class="highlight-box_rating">
            <img src="./icons/star.svg" />
            <img src="./icons/star.svg" />
            <img src="./icons/star.svg" />
            <img src="./icons/star.svg" />
            <img src="./icons/star.svg" />
            <span class="highlight-box_rating-number">5/5</span>
          </div>
          <div class="highlight-box_description">
           Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, culpa!
          </div>
          <div class="highlight-box_actions">
            <a class="actions_link" href="#"> Discover More </a>
          </div>
        </div>

        <div class="main-options">
          <div class="text-container">
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum aliquam magni accusamus ex voluptatum distinctio itaque laudantium eos praesentium tempore corporis saepe corrupti, illum at, voluptate eligendi rerum. Repellat explicabo quod obcaecati perspiciatis dolore beatae vitae maiores ad tempora. Nemo deserunt tempora necessitatibus dolorum! Possimus omnis saepe harum corporis iste?
          </div>
          <div class="text-container">
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum aliquam magni accusamus ex voluptatum distinctio itaque laudantium eos praesentium tempore corporis saepe corrupti, illum at, voluptate eligendi rerum. Repellat explicabo quod obcaecati perspiciatis dolore beatae vitae maiores ad tempora. Nemo deserunt tempora necessitatibus dolorum! Possimus omnis saepe harum corporis iste?
          </div>
          <div class="text-container">
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum aliquam magni accusamus ex voluptatum distinctio itaque laudantium eos praesentium tempore corporis saepe corrupti, illum at, voluptate eligendi rerum. Repellat explicabo quod obcaecati perspiciatis dolore beatae vitae maiores ad tempora. Nemo deserunt tempora necessitatibus dolorum! Possimus omnis saepe harum corporis iste?
          </div>
          <div class="text-container">
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum aliquam magni accusamus ex voluptatum distinctio itaque laudantium eos praesentium tempore corporis saepe corrupti, illum at, voluptate eligendi rerum. Repellat explicabo quod obcaecati perspiciatis dolore beatae vitae maiores ad tempora. Nemo deserunt tempora necessitatibus dolorum! Possimus omnis saepe harum corporis iste?
          </div>
         
          <div class="text-container">
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum aliquam magni accusamus ex voluptatum distinctio itaque laudantium eos praesentium tempore corporis saepe corrupti, illum at, voluptate eligendi rerum. Repellat explicabo quod obcaecati perspiciatis dolore beatae vitae maiores ad tempora. Nemo deserunt tempora necessitatibus dolorum! Possimus omnis saepe harum corporis iste?
          </div>
        </div>
    </div>
  </div>
  
    <section class="section">
    <p>NEXT SECTION</p>
  </section>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

ng-include once the application has finished loading

Currently, my server is using handlebars to generate the initial HTML page. I would like to include a ng-include in this page to dynamically update the client side. However, every time my application runs, it loads the page and the data-ng-include="templa ...

Incrementing numbers automatically within a JSON object while iterating through a for loop

I am struggling to figure out how to append the var i to the left side of the object declaration. This error is causing me troubles. Any assistance in resolving this issue would be greatly appreciated. If you have any alternative solutions, I am open to e ...

What is the correct way to manage a HTTP 408 error in JQuery ajax?

When making a JQuery Ajax call, I encountered an issue where the "error" method did not differentiate between an HTTP 408 error and a normal HTTP 500 error. Upon investigating, I discovered that the jxhr.statusCode was returning as 0 despite the service a ...

Receiving a commitment from an Angular Resource

When working with $resource in Angular for CRUD operations, I'm encountering some confusion regarding the usage of different resource methods. From what I've observed, the "regular" methods like save() and get() appear to execute synchronously. ...

Want to learn how to display a description below a photo when you hover over it in a photo gallery?

I am currently creating a basic photo gallery where hovering over a thumbnail displays an enlarged photo below it. My goal is to also have text displayed inside a white text box when hovering over each thumbnail, with unique descriptions for each. I need ...

View real-time data in Vuejs 3 as it executes

I am currently working on a form that populates a table with data retrieved from a Laravel API. I am using Vue.js 3 and Composition API to build my entire application. When the button is clicked, I want the table to be filled with data from the form. The b ...

Utilize information from a JSON Array to populate a JavaScript Array

Is there a way to link the data from the $data variable in ajax.php to the this.products[] array in store.js? Both files are separate, so how can I achieve this? The webpage displays the database data returned by ajax.php as shown below: [{"0":"100001"," ...

Access the value of a JSON property, return null if the key is not found, all in one line of JavaScript code

How about a fun analogy in Python: fruits_dict = {"banana": 4, "apple": 3} num_apples = fruits_dict.get("apple", None) num_oranges = fruits_dict.get("orange", None) print(num_apples, num_oranges) The result would be: 3 None If we switch gears to Jav ...

Creating responsive tabs that transition into a drop-down menu for mobile devices is a useful feature for

I am looking to create a responsive tab design that drops down like the example shown below: Desktop/Large Screen View https://i.stack.imgur.com/hiCYz.png Mobile View https://i.stack.imgur.com/gRxLv.png I have written some code for this, but I am unsure ...

Is there a way to update CSS dynamically in server-side ASP.NET?

Is there a way to dynamically change the CSS values based on the server's response? I attempted to use inline expressions, but unfortunately, it did not yield the desired outcome. @keyframes loading-1 { 0% { -webkit-transform: rotate(<%=cpuRigh ...

Mastering the art of completing a form using AJAX

I'm working on a checkbox that triggers AJAX to create a new log. It populates the necessary information and automatically clicks the "create" button. However, I'm facing an issue where the hour value is not changing. Any help on what I might be ...

One beneficial aspect of utilizing JavaScript closures for events is when defining a click event

There are two common ways to write code in JavaScript that accomplish the same task: Option A. SomeObject.prototype.hideElement = function(e, element){ e.stopPropagation(); hide(element); } Option B. SomeObject.prototype.hideElement = function( ...

Link AngularJS service array length property to the controller's scope through binding

I am attempting to connect the length of an array from another service to my controller's scope in the following manner: app.controller('TestCtrl', function ($scope, safePostService) { $scope.count = safePostService.queue.length; $ ...

Attempting to display a base-64 encoded image in a Next.js application

After following this method, I successfully uploaded my image as a string: const [image, setImage] = useState(""); //------------------^^^^^^^^^^^^^^^^------------------------- const handleImage = (e) => { ...

Mysterious and never-ending loop that seems to loop endlessly and eludes my

My prototype includes a method for adding callbacks: /* * Add a callback function that is invoked on every element submitted and must return a data object. * May be used as well for transmitting static data. * * The callback function is supposed to e ...

Tips on resolving the distinct key issue in React and eliminating it

Attention all React beginners! I'm encountering an issue that states: Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `resultTable`. See https://fb.me/react-warning-keys for more information. ...

Transition the object in smoothly after the slide has changed

How can I make the h4 tags fade in after the divs slide into view, while also adding the class "current" to each visible slide? Check out the example on JSFiddle here. <div class="slider"> <div class="slides"> <div class="slide ...

Unable to retrieve observable modifications

In my code file for handling reports, named report.service.ts, I have a method that retrieves reports data. This method simply returns a constant array of report objects from a mock source. Here is the implementation: @Injectable() export class ReportServ ...

Testing infinite scrolling with the help of protractor

It seems like the infinite scrolling feature in ng-grid is not exactly infinite, but it's the closest comparison I could come up with for what I am observing. In our application, we are using ng-grid to display data in a table with approximately 170 ...

Angular JS: Grabbing Text from a Specific div and Copying it to Clipboard

I recently developed a Random Password Generator using Angular JS. Here is how the output appears in the application: <div data-ng-model="password" id="password"> <input class="form-control" data-ng-model="password" id="password" placeholder=" ...