Jump to content
Search Community

Empty Blank space below div

Charlyta test
Moderator Tag

Recommended Posts

Hi Cahrlyta,

 

You're adding the great blank space yourself with the following JS in your code:

 

function setHeight() {
  height = container.clientHeight
  document.body.style.height = height + "px" // <- This bit here.
}

I don't know why you are adding it or what is the effect you are after but that's what is causing the big white space.

 

A tip for the future, try to simplify your code all the way to the bare minimum possible when trying to work things out. In this sample of yours, you have far more code, HTML, CSS and JS needed to illustrate your issue. I bet if you stripped it down yourself, you would have worked out what was going on.

  • Like 1
Link to comment
Share on other sites

Hey Charlyta!

 

Thanks for simplifying your example, it's much easier to reason now.

 

I see you are using Locomotive Scroll - I have zero experience with it but had a quick look at their documentation and noticed some discrepancies on your setup to theirs. I think you are setting things up wrongly. I can't say exactly what though.

 

What do you mean by "a simple scroll using grid"? Do you mean you want the scrolling to be smooth? If that's the case and you don't want to be (or can't afford) a Club Greensock member, you'll have to read into Locomotive Scroll documentation because the issue is likely to be with its setup.

Link to comment
Share on other sites

First, why did you downgrade GSAP to use v1.x.x? That's super, super, super old. I'd advise against that.

 

From this exchange that we are having I can only conclude that your question really is "how can I create a smooth scroll without using GSAP's ScrollSmoother"? Because it's super simple using GSAP.

 

Ultimately, your question has nothing to do with GSAP, there's very little we can do to help you here as we're limited on the amount of support offered because there is only a small group of volunteers and an even smaller GSAP team.

 

Howerver, you're in luck as I was curious enough to see how does Locomotive scroll works. See here what a Locomotive setup looks like:

 

See the Pen 17b6d25ee70ea34d37ab2a0e666937b1 by dipscom (@dipscom) on CodePen

 

Notice you need to add some CSS as well as the JS package for the library.

 

Right, you should be good to go. Remember we won't be fixing your issues here. We will only be able to help you with GSAP-related issues.

 

Happy tweening!

Link to comment
Share on other sites

  • 2 weeks later...

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...