Even after reaching the bottom of the page, the div for overlay projects continues to scroll

*{
  margin: 0;
  padding: 0;
}

body{
  font-family: helvetica , sans-serif;
  background-color: #1E1E20;
}

.parallax-container {
  /* The image used */
  background-image: url("https://i.sstatic.net/BlF.jpg");
  animation-name: pixels;
  animation-duration: 800ms;
  animation-timing-function: steps(8,end);
  animation-delay: initial;
  animation-iteration-count: infinite;
  animation-play-state: initial;
  position: relative;
  /* Set a specific height */
  min-height: 800px; 
  /* Create the parallax scrolling effect */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@keyframes pixels {
  100% {
    background-position: 100% 0;
  }
}

.parallax img{
  z-index: 2;
  position: fixed;
  top: 0px;
  padding: auto;
}

.header_nav_container a, h3, h4{
  font-family: Helvetica,sans-serif;
  font-size: 40px;
  font-weight: bold;
  color:white;
}

.header_nav_container h1{
  font-family: Helvetica, sans-serif;
  font-size: 80px;
  text-align: center;
  color: white;
  top: 250px;
  z-index: 4;
  position: relative;
}

.header_nav_container a{
  top: 50px;
  left: 50px;
  text-decoration: none;
  position: relative;
}

.header_nav_container h3{
  top: 50px;
  right: 50px;
  position: absolute;
}

.header_nav_container h4{
  top:90px;
  right: 50px;
  position: absolute;
  font-size: 30px;
  color: yellow;
}


.header_nav_container span{
  text-shadow: 8px 8px black;
}

.projects_container h1{
  font-size: 50px;
  text-align: center;
  color: white;
  font-family: helvetica, sans-serif;
  margin-top: 20px;
}

.front p{
  padding: 10px;
  text-align: center;
  font-family: helvetica, sans-serif;
  font-size: 30px;
  color:white;
}

.underscore{
  color: yellow;
}


.flip3D{ width:240px; height:200px; margin:150px 60px; float:left; }
.flip3D > .front{
  position:absolute;
  transform: perspective( 600px ) rotateY( 0deg );
  background:#1E1E20; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D > .back{
  position:absolute;
  transform: perspective( 600px ) rotateY( 180deg );
  background: #80BFFF; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D:hover > .front{
  transform: perspective( 600px ) rotateY( -180deg );
}
.flip3D:hover > .back{
  transform: perspective( 600px ) rotateY( 0deg );
}

.pic1{
  border-radius: 7px;
}

.front{
  border: 2px solid yellow;
}

.projects{
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

There seems to be an issue with the overlapping PROJECTS div. It continues scrolling down even after reaching its end, causing the background to become visible.

Here is the background image (grey.jpg)

And here is the image placed on top of the background (shadow.png)

I would like the scrolling effect to stop once it reaches the desired point.

For reference, visit this link.

Answer №1

*{
  margin: 0;
  padding: 0;
}

body{
  font-family: helvetica , sans-serif;
  background-color: #1E1E20;
}

.parallax-container {
  /* The image used */
  background-image: url("https://i.sstatic.net/BlFbi.jpg");
  animation-name: pixels;
  animation-duration: 800ms;
  animation-timing-function: steps(8,end);
  animation-delay: initial;
  animation-iteration-count: infinite;
  animation-play-state: initial;
  position: relative;
  /* Set a specific height */
  min-height: 800px; 
  /* Create the parallax scrolling effect */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@keyframes pixels {
  100% {
    background-position: 100% 0;
  }
}

.parallax img{
  z-index: 2;
  position: fixed;
  top: 0px;
  left: 0;
  right: 0;
  margin: 0 auto;
}

.header_nav_container a, h3, h4{
  font-family: Helvetica,sans-serif;
  font-size: 40px;
  font-weight: bold;
  color:white;
}

.header_nav_container h1{
  font-family: Helvetica, sans-serif;
  font-size: 80px;
  text-align: center;
  color: white;
  top: 250px;
  z-index: 4;
  position: relative;
}

.header_nav_container a{
  top: 50px;
  left: 50px;
  text-decoration: none;
  position: relative;
}

.header_nav_container h3{
  top: 50px;
  right: 50px;
  position: absolute;
}

.header_nav_container h4{
  top:90px;
  right: 50px;
  position: absolute;
  font-size: 30px;
  color: yellow;
}


.header_nav_container span{
  text-shadow: 8px 8px black;
}

.projects h1{
  position: relative;
  z-index: 5;
  font-size: 50px;
  text-align: center;
  color: white;
  font-family: helvetica, sans-serif;
  margin-top: 20px;
}

.front p{
  padding: 10px;
  text-align: center;
  font-family: helvetica, sans-serif;
  font-size: 30px;
  color:white;
}

.underscore{
  color: yellow;
}


.flip3D{ width:240px; height:200px; margin:150px 60px; float:left; }
.flip3D > .front{
  position:relative;
  transform: perspective( 600px ) rotateY( 0deg );
  background:#1E1E20; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D > .back{
  position:absolute;
  transform: perspective( 600px ) rotateY( 180deg );
  background: #80BFFF; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D:hover > .front{
  transform: perspective( 600px ) rotateY( -180deg );
}
.flip3D:hover > .back{
  transform: perspective( 600px ) rotateY( 0deg );
}

.pic1{
  border-radius: 7px;
}

.front{
  border: 2px solid yellow;
}

.projects{
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}
.projects_container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: 100%;
    background-color:#1E1E20;
    position: relative; 
    top: 0px; 
    z-index: 3;
    margin-top: -80px;
}
<header>
  <div class="parallax-container">
    <nav class="header_nav_container">
      <h3>HAHAHA</h3>
      <br>
      <h4>Portfolio</h4>
      <a href="www.google.com/about">About</a>
      <h1>Hi,I'm <span>HAHA</span> </h1>
    </nav>
    <div class="parallax"><img src="https://i.sstatic.net/8pYB9.png" width="500px" 
      height="800px"></div>
  </div>
</header>
<section class="projects">
  <h1>PROJECTS<span class="underscore">_</span></h1>
  <div class="projects_container">
    <div class="flip3D">
      <div class="back">Box 1 - Back</div>
      <div class="front"></div>
    </div>
    <div class="flip3D">
      <div class="back">Box 2 - Back</div>
      <div class="front">Box 2 - Front</div>
    </div>
    <div class="flip3D">
      <div class="back">Box 3 - Back</div>
      <div class="front">Box 3 - Front</div>
    </div>
    <div class="flip3D">
      <div class="back">Box 4 - Back</div>
      <div class="front">Box 4 - Front</div>
    </div>
  </div>
</section>

https://jsfiddle.net/Sampath_Madhuranga/xpvt214o/616850/

Give this a try. It's functioning correctly. Please notify me if you encounter any issues. Thank you.

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

Animation scaling on the iPhone seems to abruptly jump away once it finishes

Encountering an issue with animations that is causing unexpected behavior on physical iPhone devices but not in the simulators. The problem arises when the background zooms in and then the div suddenly jumps to the left after the animation completes, as sh ...

Updating the CSS properties of a specific element within a dynamically generated JavaScript list

So I'm working on a JavaScript project that involves creating a navigation bar with multiple lists. My goal is to use the last list element in the bar to control the visibility (opacity) of another element. So far, I have been using the following code ...

What is the best way to incorporate a floating label into an input field?

My goal is to create a form where the label of the input field moves up when the user starts typing, and stays up if they enter any text. However, if the user leaves the input area blank, the label should revert back to its original position. I have tried ...

Flexbox and CSS3 width/height declarations causing problems with vertical alignment

Struggling to vertically center a nav element and align it to the right of the screen? There seems to be something causing it to shift slightly off-center. In this setup, the red represents the flex container, the green is the header, and the grey box is ...

When using jQuery's .each method, only the final JavaScript object element is added to the divs

I have a unique set of dynamically-created divs, each containing a Title. When a div is clicked, a modal opens (which is cleared upon click), and the Title is displayed again in the modal. My goal is to add the category descriptions into these modals, but ...

JavaScript event listener 'click' not functioning properly

I'm facing an issue with a click event in a script that is associated with a specific div id. When I move the mouse within the div area and click (the cursor remains unchanged), the event listener does not activate. How can I make the div area clickab ...

Select Box in HTML now supports the addition of a Background Image, enhancing

Currently, I am trying to customize the select option box using HTML and CSS. My main goal is to incorporate a scroll feature into the option box. However, I have encountered an issue where the image of the checked box remains visible on the screen. Below ...

Customizing checkboxes in React with JSS: A step-by-step guide

I'm currently working on customizing CSS using JSS as my styling solution, which is proving to be a bit complex while following the w3schools tutorial. https://www.w3schools.com/howto/howto_css_custom_checkbox.asp HTML: <label class="container"& ...

Issues with Magento Shopping Cart upon using the browser's back button

I use a modified version of Magento 1.6.2 with significant customizations, particularly to the shopping cart template. Encountering an issue when users click the 'back' button in the browser after adding an item to the shopping cart. This proble ...

use two separate keys for grouping in JavaScript

My current approach involves using the reduce method to organize the data based on the Id of each query. var data = [ {Id: "552", valor: "50.00", Descricao: "Fraldas", }, {Id: "552", valor: "35.00", Descricao: "Creme", }, {Id: "545", valor: "2 ...

Integrating jQuery Tooltip with Mouseover Event

I'm currently involved in creating a map of MIT projects for an architectural firm, and facing the challenge of maintaining the red dots mouseover state even when the mouse hovers over the tooltips that appear. Presently, the mouseover effect turns of ...

In an HTML template, what is the significance of the $ symbol?

Currently, I am exploring the web.py framework with the help of a tutorial that I found online. This tutorial focuses on Python and AJAX functionalities. One thing that is confusing me in the tutorial is the use of variables with a $ sign in the tutorial ...

Modify the bootstrap dropdown background to display only an image

I am looking to make the image in a dropdown/dropup menu fill the entire background of the dropdown. Currently, there is still white space visible around the image. How can I ensure that the dropdown shows only the image and includes a scroll wheel? Addit ...

The webpage displays the element as <span class="icon">&#xe80d;</span> instead of rendering it properly

In my ReactJS project, I have created a component called Menu1item: class Menu1item extends React.Component{ render(){ return ( <div> {this.props.glyph}{this.props.value} </div> ) ...

The Webix component is experiencing a lack of refreshment

function refresh_group_items(){ //console.log("calling1"); window.setTimeout(function(){ $$("cfg").reconstruct() }, 3000); } $.ajax({ type: "POST", xhrFields:{ withCredentials: true }, beforeSend: function(reque ...

element obscured by overlapping elements

I'm unsure why this issue is occurring; it seems to be a CSS error, but I can't pinpoint the exact location. Working on this in Rails, so I'm relatively new to it, but it should follow standard CSS practices! The "ticket" element appears t ...

What is the best way to organize a form's checkboxes into an array using Node.js?

My goal is to design a form with multiple checkboxes where each checkbox has the same name, and only the selected values are submitted with the form. While I know how to achieve this using PHP as demonstrated in this SO question, I am facing difficulty imp ...

Is it feasible to distribute logic across Components?

My components all serve the same purpose: They display a form (with varying HTML) Capture the form data Validate and send the form using a REST API I am trying to find a way to share common elements among these components. For instance, each form includ ...

`Is there a way to manipulate the timer in JavaScript?`

My current project involves creating a timer in minutes and seconds. The user inputs the desired time in minutes into a textbox named "textbox2". However, when I attempt to retrieve the value of this input using `getElementById.value`, it returns a NULL er ...

Struggling to get the fluid image feature to work properly on Bootstrap 4

I seem to be facing an issue with creating responsive images using Bootstrap 4. Whenever I view the code below on a browser, I see three images in the navbar at the top left corner. Unfortunately, these images do not scale down in size when viewed on mobil ...