Two sets of scrolling bars

Having an issue with my JSFIDDLE parallax effect causing two scrollbars in the result. How can I ensure there is only one scrollbar for all my content?

Here is some of the HTML code:

<div id="intro">
<p>Sed uelit, sed quia...</p>
</div>

<div id="text">
<h1>Hello</h1>
</div>
<div id="wrapper">
    <section id="frame1">
        <div class="back">
        </div>
    </section>


        <section id="frame7">
        <div class="back">

        </div>
    </section>

</div>

Answer №1

The reason for the appearance of a second scrollbar lies in the default box-model behavior of #wrapper and its 3px border. To solve this issue, you can rectify it by setting box-sizing:border-box; for #wrapper, thus containing the border within #wrapper. Check out the demo here: https://jsfiddle.net/qrsotzpr/9/

Answer №2

If you want to prevent overflow in the #wrapper element, you can use the CSS property overflow: hidden;

#wrapper {

      transform-style: preserve-3d;
      height: 100%;
      perspective: 1px;
      overflow: hidden;
      border:3px solid cyan;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;

    }

Answer №3

To prevent content from overflowing, you can apply the CSS property overflow: hidden; to the body element. See a live example here:

https://jsfiddle.net/k5zwqvjd/

The overflow property determines how content should behave when it exceeds the boundaries of its containing element.

For more information, refer to the documentation here.

body {
  overflow: hidden;
  margin: 0;
}

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

"The Zorro table is filled with items of various types, although unfortunately, the Intellisense is not as accurate as it

Imagine a scenario where you have a basic table set up: <nz-table #table [nzData]="users"> <thead> <tr> <th>Id</th> <th>First Name</th> <th>Last Name</th> </tr> ...

Position the image on top of the details

I have an image with a spinner rotating around it through animation, accompanied by two boxes containing information as depicted in the uploaded image below. However, I would like to position the image above the boxes rather than beside them. .about-img ...

Adjust the text within the treeview node for proper alignment

My treeview has nodes that display text, but when the length of the text increases, it moves to the next line and starts one place before the upper text, causing alignment issues. Is there a way to use CSS or JavaScript to properly align the text? Regards ...

How can I make a clickable <div> easily navigable with tab functionality?

I am currently tackling a project that involves implementing an onclick event within a <div>. While I've successfully set up the primary functionality, there is one issue at hand. Specifically, I need the onclick event to trigger when a user nav ...

Attempting to transfer a char pointer to the "QUERY_STRING" to a char array variable, but receiving an incorrect outcome

I'm currently working with FastCgi to create a dynamic HTML webpage. While I can easily retrieve the QUERY_STRING, I am facing difficulties in copying it into a char array. If there's a more efficient way to extract the value from QUERY_STRING, ...

What is the best way to toggle the display using Jquery?

I'm in the process of setting up a FAQ page where answers can be toggled for display. Here is the step-by-step guide on how to achieve it: $(document).ready(function () { $('.faqlink').click(function () { $('.hiddenFAQ&ap ...

CSS border alignment techniques

I am attempting to achieve the effect of having an orange border on top of a blue border, with only the orange border moving. I have noticed this design feature on various websites but have been unable to replicate it without removing the padding of the pa ...

I would like to split the window into four columns and populate each one with images

I've been struggling to create 4 columns in my design, but I just can't seem to make it work. I've tried setting the height to 100% in each div, but it didn't produce the desired result. I was able to achieve it with colors, but not wit ...

Creating a div resizing function using only JavaScript is a fun and useful project to tackle

Seeking help to create a div resizer using only pure JavaScript as jQuery is restricted. The current functionality works, but breaks when the position of the slider-div is not set to absolute. Any solutions to fix this issue would be greatly appreciated. ...

What is the best way to design this layout using HTML and CSS?

Can someone help me achieve this specific layout? / header width:100%, height: 100px (overlayed) / ///////////////////////////////////////////////////////////////////////////// / / ...

Foundation 6: Alignment issues with Top Bar

Exploring Foundation 6 and trying out the sample code. I'm puzzled as to why the "Site Title" is not in alignment with the rest of the top-bar, it seems to be slightly higher up. <div class="top-bar"> <div class="top-bar-title"> ...

Adjust the contents of a DIV depending on which Toggle button is selected

When a user clicks on either "Twin Bed" or "King Bed", the content inside the "demand-message" should change to either "high demand" or "Only ??? rooms left". The ID will remain the same for both buttons due to existing logic. However, the message display ...

Changing the size of the logo as you scroll through the page

I have implemented the following code to resize the logo as I scroll down the page. $(document).on('scroll', function() { if ($(document).scrollTop() >= 10) { $('.logo img').css('width', '50px'); } else ...

Only show the picture if it exists

Currently, I am in the process of developing a browser extension (content script) that is capable of scanning and highlighting specific words on a webpage. This extension utilizes AJAX and PHP to display content in a tooltip when a user hovers over these h ...

Enhance User Interaction by Making HTML Elements Clickable on Top of Three.js Render

I'm currently working on an animation project using Three.js that involves moving objects. In this animation, I've created a text bubble that appears when an object is clicked, along with an "X" button to close it. However, I'm facing an iss ...

Change the function from onLoad to onClick exclusively

I'm experiencing a particle explosion on my webpage due to this code. I connected the onClick function to a button in my HTML so it executes only when that specific button is clicked. However, the function automatically runs when I load the HTML and ...

How to turn off pinch to zoom feature in Mozilla Firefox on a Microsoft tablet or touch screen display

My goal is to enable zooming and panning for an SVG across all devices and browsers. I've successfully implemented this using panzoom.js. However, I'm encountering an issue specifically with Mozilla Firefox on tablet devices and Windows touch sc ...

What is the best approach to streamline this Jquery solution?

In my current jQuery setup, I have the following: $("button").click(function() { var counter = 1 $("tr td:nth-child(2)").text(counter); click ++; }); Instead of using; $"(tr td:nth-child(2)").text(counter); I am looking to implement .slice() to ...

Is it possible to dynamically change the background image using ReactJS?

I attempted to dynamically change the background image style for the div below: Below is my code snippet for implementation: render: function() { var divImage = { backgroundImage : "url(" + this.state.song.imgSrc + "),url(" + this.state.nextImgSrc ...

ways to invoke javascript function on body loading

I'm struggling to invoke a JavaScript function when the body loads. Currently, I have the function call on a button but cannot get it to work when added to the body load event. HTML: <body onload="bodyload();"> JavaScript: function bodyload( ...