Jump to content
Search Community

ScrollTrigger - extra space by scrollbar

dan111

Go to solution Solved by GreenSock,

Recommended Posts

Posted

Hello, I was trying to recreate the GSAP demo of layered pinning: 

See the Pen QWNpMao by snorkltv (@snorkltv) on CodePen.

In my version each section is a little too narrow for the screen, so the layer below shows through until it reaches the top trigger point, then it takes up the whole width but the same problem happens with the next section coming up.

I can't work out why this is happening - I've tried it with Edge and it works fine with no gap, so it's only an issue in Chrome  (I've only tried Edge and Chrome, and only in codepen).

 

Thanks.

 

image.thumb.png.2be2059d1ad2a2fabfc26744ebd83c78.png

See the Pen gOJxzmb by Daniel-Imray (@Daniel-Imray) on CodePen.

  • Solution
Posted

That looks like a CSS issue. You've got overflow-x: hidden applied to EVERY element instead of just the body. 

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

But this seems to resolve it: 

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {  
  overflow-x: hidden;
}

See the Pen XWwaOPW by GreenSock (@GreenSock) on CodePen.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...