Jump to content
Search Community

Full Screen Slides with Site content below

curiositymg test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I am looking to add a content section below the listed codepen URL.  Basically our client wants to have a scrolling intro section, and when the section (say slide 5)  after the 4 intro sections scrolls,the scroll bar is re-enabled.

I hope this makes sense.  Is there an additon to this codepen that I can add to enable it again?

 

See the Pen kDvmC by bassta (@bassta) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Yep that codepen by Chrysto is awesome and a very good starting point.

 

What you could do is get the total amount of slides and set up a variable that starts at 0. Then after the user goes to the next slide increase the value and when the user reaches the final slide (here a conditional can be used) and advances once more, you can hide the final slide and change the overflow property of the site wrapper. In this case I would strongly recommend using a site wrapper and not mess with the <body> or <html> tags, which ultimately will result in quite a nightmare.

 

Also if you want to allow the user to go back to the slides at any time, you'll have to use jQuery's scrollTop() to check if the scroll value is 0 and the user is scrolling up.

 

Finally if you're interested in using touch events I would recommend you using Hammer, which works very well.

 

Rodrigo.

  • Like 2
Link to comment
Share on other sites

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