100vh nested section with scrolling

I am attempting to create a section that remains fixed as you scroll, allowing the inner articles to scroll by 100vh within the section. Essentially, I want to have a block of section with a height of 100vh and then scroll the inner articles by 100vh:

HTML :

  <section class="lorem">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Facilis similique 
  expedita dolore, suscipit, 
  velit temporibus iusto ad, praesentium officia nemo nihil rerum necessitatibus excepturi 
  possimus 
   tempora maxime quam dolor culpa.</section>

<section id="process">
      <article><h1>THIS IS ARTICLE 1</h1></article>
      <article><h1>THIS IS ARTICLE 2</h1></article>
      <article><h1>THIS IS ARTICLE 3</h1></article>
      <article><h1>THIS IS ARTICLE 4</h1></article>
      <article><h1>THIS IS ARTICLE 5</h1></article>

</section>
    
<section class="lorem">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Facilis 
similique expedita dolore, suscipit, 
velit temporibus iusto ad, praesentium officia nemo nihil rerum necessitatibus excepturi 
possimus 
tempora maxime quam dolor culpa.</section>

CSS :

#process{
    width: 100%;
    position: relative;
    z-index: -1;
    background: black;
    color: white;
    font-size: 5rem;
    height: 100vh;

}
#process article{
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.lorem{
    width: 100%;
    height: 100vh;
    font-size: 3rem;
}

I am looking to achieve a scrolling effect where when the page reaches the second section, it becomes fixed on the screen. The inner articles will scroll within this fixed section, maintaining the same background. Once the user finishes reading the articles, the page will continue scrolling to the third section. How can I accomplish this?

EDIT :

Here is an example similar to what I am trying to achieve.

Answer №1

Lower the height for an improved perspective. Can you provide more information on your query?

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

Tips for hovering over a link with Webdriver

Currently, for my project, I am utilizing Selenium Webdriver. Successfully automating the functionality to mouse over an image has been achieved. However, there seems to be an issue when attempting to trigger a mouse-over event on a hyperlink using the sam ...

Content within a div that is floated left

The scenario at hand is: HTML Structure: <div id="main"> <div id="a"></div> <div id="b">Some Text</div> </div> CSS Styles: #a{ float:left; width:800px; height:150px; background-color:#CCC; } ...

When the Next.js app is built, the API route provides the initial data, which typically occurs during development

I am encountering an issue with my Next.js page using App Router. The page retrieves data from its route API, which is obtained from MQTT. During development (running dev), when we send a request to api/getLocation, it returns updated data from MQTT. Howev ...

Using the function to show content by calling its assigned ID

<script type="text/javascript"> function selectRow(id){ $.get("http://inactive/test.php?id=" + id, function(data,status){ return data; }); } </script> <script type="text/javascript"> $("tr").click(function() { window.l ...

Custom validation on the client side using ASP.NET and JavaScript WebMethods

I am encountering an issue with client-side validation using a JavaScript function. On my ASP.NET C# page, I have a WebMethod that successfully validates data entered by the user. The page includes a textbox with an AJAX AutoCompleteExtender, which is work ...

Retrieving CSV files from an Express backend for use in an AngularJS application

I came across a similar question on Stack Overflow, but unfortunately the solution provided did not work for me. When I tried using the code snippet mentioned: $('<form action="'+ url +'" method="'+ ('post') +'">&a ...

Ways to manage multiple Observables

Two Observables are being returned from different services, each providing only one value (similar to Observable.just()). In TypeScript, types play a crucial role in this context. Is there a method to determine when both Observables have been resolved (in ...

Jade: Incorporating a JavaScript file at a specific location

Is there a way to include a file that is specifically used when rendering a jade file on the client side? Here is an example of the .jade file: button(type="button")#start.flex p#timer.flex button(type="button" )#stop.flex script(src='../public/js/ti ...

Determine whether a div that has been generated automatically has been selected by the user

My JSON file contains a list of elements, each creating a container. See the code below: $.getJSON('/data/risks.json', function(data) { var html = ''; $.each(data.risk, function(key, value){ html += '<div class="elementlis ...

JavaScript Money Exchange

Can currency be recalculated using JavaScript or jQuery? For instance: <div id="price">$99.00</div> Could become <div class="gbp" id="price">£63.85</div> If a class of "GBP" was added to the div tag? ...

Trouble with closing Bootstrap 4 modal

My Bootstrap 4 modal is causing issues as it pops up on button click but won't close unless I refresh the page. I've been attempting to get it to close by clicking the 'close' button or simply by clicking anywhere on the main page body. ...

How can I customize the color of the Title Component in Ant Design using Styled Components?

I am currently integrating Ant Design with styled components in my project. One of the components in my application is a NavBar that includes an H1 Component. H1.tsx import React from 'react'; import { Typography } from 'antd'; impor ...

After rendering a list of items using a React component, the list suddenly vanishes from

Encountering an issue with my React component that renders a list of items, where the ids of each item briefly appear before disappearing and console logging as undefined. The component in question looks like this: const Posts = ({ state }) => { // c ...

Node.js - Request timeout issue: Headers cannot be set after they have already been sent

My node.js app is running with mongoose, express, mongodb. I have a 'team' page that displays teams from the database. Everything was working fine until I added the code below. Now, when I navigate to the page and refresh it or try to load it aga ...

Elements inside the Bootstrap 3 navbar are actually external

I am having trouble with the collapsible navbar, specifically the alignment of the right side. Here is the code snippet related to it: <div class="collapse navbar-collapse navHeaderCollapse"> <ul class="nav navbar-nav navbar-right"> ...

MongoDB does not always insert the complete array

For inserting 499 entries into a subdocument from an array, I have the following code snippet: var bodyParser = require('body-parser'); var express = require("express"); var path = require("path"); var session = require('express-session&apo ...

Calling Number() on a string will result in returning a value of NaN

Currently, I am working on the following code snippet: app.put("/transaction/:value/:id1/:id2", async(req,res) => { try { const {value,id1,id2} = req.params; const bal1 = await pool.query("Select balance from balance where id=$1",[i ...

Searching for $or command in express.js

Is it possible to use $or in the app.get() function of an express.js application? For example, how would I write a find() query that includes $or like this: db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } ) I'm curious about ...

Determine if the browser is utilizing GPU acceleration for rendering graphic content

Currently working on a large-scale website that utilizes CSS3 transitions for animations (leveraging jaquery.transit to manipulate element transitions and their CSS styles). Encountered two challenges in the process: It appears that Firefox (latest updat ...

Issue [ERR_HTTP HEADERS_SENT]: Inability to change headers once they have been sent to the client in a Node.js environment

When accessing the following URL - http://localhost:3080/api/msgs/[email protected], I am expecting to retrieve all user commits. However, I am only retrieving one user commit and encountering the error [Error [ERR_HTTP_HEADERS_SENT]: Cannot set heade ...