Steps to remove the parallax inner scrollbar

I've been experimenting with adding a parallax effect to the 'about us' page on my website. I successfully achieved the desired effect using pure CSS, but encountered an issue with an inner scrollbar appearing within the container div.

PS. This is for a Magento store and unfortunately, I'm unable to modify the main div.

Below is the HTML code:

<div class="container">
   <div class="parallax-wrapper">
      <div class="section parallax bg1"><span>Your Passion Is Our Passion!</span></div>
      <div class="section static">
         <p>Since more than 12 years ....</p>
      </div>
      <div class="section parallax bg2"><span>Large Choice Of Products</span></div>
      <div class="section static">
         <p>We are proud to offer you a large variety of products for every budget and taste.</p>
      </div>
      <div class="section parallax bg3"><span>Dedicated Customer Service</span></div>
      <div class="section static">
         <p>Our staff's only goal is to offer you a unique and professional experienxe.</p>
      </div>
      <div class="section parallax bg1"><span>Happy Shopping!</span></div>
   </div>
</div>

And here is the CSS:

.parallax-wrapper{
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 2px;
}

.section{
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 0 5px #000;
}

.parallax::after{
    content: " ";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateZ(-1px) scale(1.5);
    background-size: 100%;
    z-index: -1;
}

.static {
  background: red;
  height: 200px;
}

.bg1::after {
  background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg1.jpg);
}

.bg2::after {
  background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg2.jpg);
}

.bg3::after {
  background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg3.jpg);
}

I aim for the parallax effect to occur when the user scrolls through the entire page, rather than the unintended inner scrollbar created by my code.

Answer ā„–1

Inserted body css code into the document

body {
  margin: 0px; /* this line has been included */
}

.parallax-wrapper{
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 2px;
}

.section{
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 0 5px #000;
}

.parallax::after{
    content: " ";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateZ(-1px) scale(1.5);
    background-size: 100%;
    z-index: -1;
}

.static {
  background: red;
  height: 200px;
}

.bg1::after {
  background-image: url(https://loremflickr.com/320/240);
}
<div class="container">
   <div class="parallax-wrapper">
      <div class="section parallax bg1"><span>Your Passion Is Our Passion!</span></div>
      <div class="section static">
         <p>Since more than 12 years ....</p>
      </div>
      <div class="section parallax bg2"><span>Large Choice Of Products</span></div>
      <div class="section static">
         <p>We are proud to offer you a large variety of products for every budget and taste.</p>
      </div>
      <div class="section parallax bg3"><span>Dedicated Customer Service</span></div>
      <div class="section static">
         <p>Our staff's only goal is to offer you a unique and professional experienxe.</p>
      </div>
      <div class="section parallax bg1"><span>Happy Shopping!</span></div>
   </div>
</div>

Answer ā„–2

To eliminate the overflow properties, replace them with a background-attachment property set to fixed.

The scroll bars are being displayed due to the overflow properties currently in place.

When editing your CSS, be sure to make these adjustments accordingly:

.parallax-wrapper{
height: 100vh;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center;
perspective: 2px;
}

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

Click a button to adjust the height of an element

My webpage features a dashboard with tabs on the left and corresponding content on the right. To ensure proper alignment, I have utilized Bootstrap to create two columns - one for the tabs and one for the content. However, I am facing an issue where the bo ...

Discovering the quantity of identical elements within a JavaScript array

Looking for some assistance in solving a JavaScript problem as I am relatively new to the language: I have an array and I need help in determining the count of identical values. Below is my array: var arr = ["red", "blue", "green", "red", "red", "gray"] ...

How can I add a hyperlink to a Javascript string array?

I am currently facing a challenge in adding a hyperlink to a string using .link and .innerHTML methods. I believe there might be a misunderstanding on my part as I am quite new to this. Here is the code snippet I have been working with: <div id="type ...

Vue JS nested component does not appear in the document object model

I developed two separate VueJS components - one displaying a modal and the other featuring HTML input fields. When I attempt to nest these two components, the inner component fails to appear in the DOM. What could be causing this issue? Here's a snip ...

Utilizing CSS to Target IDs Using Classes

Recently, I came across a captivating video on YouTube demonstrating how to create a transitional gallery (http://www.youtube.com/watch?v=4sVTWY608go). Inspired by the tutorial, I attempted to implement a similar slider... However, I now have a new idea. ...

Tips for globally overriding MUIv4 class in JSS for nested themes

Summary: Skip to EDIT2 MUIv4 has generated the following classes for me based on my nested theming: <label class="MuiFormLabel-root-121 MuiInputLabel-root-113 MuiInputLabel-formControl-115 MuiInputLabel-animated-118 MuiInputLabel-shrink-117 M ...

CSS: Ensuring the width is adjusted to the content or wrapper that is wider

I am facing an issue with mouse-over highlighting on a set of list items. Below is the HTML structure I am working with: <div id="wrapper"> <div id="box"> <div class="item">Lorem ipsum dolor sit amet, sit nonumy utamur ponderum ex& ...

Can you tell me the Bootstrap 4 equivalent class for '.well'?

While using bootstrap-3, the .well class can be utilized to create a rounded border around an element with a gray background color and padding. <div class="well">Basic Well</div> However, it seems that there is no .well class available in boo ...

Is the first column of the table occupying excessive width?

I am attempting to create a table with two columns for questions and answers. The first column should only display the question number, aligning the actual question and answer in the second column. However, I prefer the question number to be next to the q ...

Displaying images and styling with Google App Engine and Django

I've been struggling to understand how to manage the exposure of CSS files and images in my project. I've come across many examples for Django or other frameworks, but nothing specifically addressing a combined case. Any assistance would be great ...

Initiating a web-based compiler directly through a browser using any method possible

Currently, I am developing a web-based educational tool that allows students to view code examples in a browser and edit them directly within the browser. I have been exploring ways to incorporate a client-side compiler so that they can run and debug the c ...

Utilizing Jquery cycle to overlay a div on top of a scrolling image

Hey there! I'm currently using the jquery.cycle.all.js plugin for my website. I've encountered an issue where I want to position a menu div on top of an image slider. The menu is in the correct location, but unfortunately, it's hidden benea ...

Using Java's Selenium WebDriver to select and click on an item in a list

<div class="class0"> <div class="class1"> <input tabindex="4" id="pqr" autocomplete="off" type="text"> </div> <ul class="class2"> <li class="group-result">polka</li> <li class="active-result g ...

Unable to retrieve DOM value due to Vue.js template being inaccessible in Chromium, including from both DevTools and extensions

Currently, Iā€™m developing a Chrome extension that needs to retrieve specific values from a webpage such as the item title. However, instead of fetching the actual title, it is reading a Vue.js template variable. Even when I use DevTools to inspect the p ...

Slowdown in functionality

My current project involves creating a user interface for an Oven configuration application using CSS, Java Script, Jquery & Json. While the interface performs actions within milliseconds on browsers and simulators, my client has noticed that it takes seco ...

Is there a way to synchronize the autohide duration for both the LinearProgress MUI and SnackBar components?

Can someone help me align my SnackBar with the LinearProgress so that they both have an auto-hide duration of 4 seconds? I've been struggling to figure it out for hours and haven't found a solution yet. Could the issue be in the useEffect part of ...

Issue with Jdenticon icons not displaying correctly in ng-repeat loop

Recently, I started using the Jdenticon JavaScript library for generating user icons. This library allows me to input a hash and then render it as either SVG or Canvas. Here is an example code snippet: <svg width="200" height="200" data-jdenticon-has ...

Looking for a list that you can edit with CSS styling?

I'm struggling to create a flexible list that can be easily modified. My goal is to have an ordered list with unique labels such as 1,2,3,4,5,6,7,8,9,0,A,B,!,# Although I've managed to number the list items, I am stuck on adding the extra label ...

Having trouble seeing the output on the webpage after entering the information

I can't seem to figure out why the result is not displaying on the HTML page, so for now I have it set up as an alert. <h1>Factorial Problem</h1> <form name="frm1"> Enter any number :<input type="text" name="fact1"& ...

Obtaining the ID of a moved item in Uikit's nestable component

I am currently utilizing the uikit framework and have a query regarding the nestable component. Despite seeking assistance in various places, none of the solutions seem to match my specific needs. My limited knowledge of JavaScript may be a contributing ...