Jump to content
Search Community

Continuous Scrolling background

celli 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 trying to achieve a continuous scrolling background, and I have set up a .png that is twice as long as my container so that it can repeat and start and stop in the exact same position.


I am using the background position property, which works, but I see the "repeat:-1" still has a slight pause every time it repeats, so this is very noticeable if you want to create a scrolling background that appears continuous, like for a scrolling star background.


I altered the code at the codepen to this with linear easing, but every combination of easing and repeating, even with negative delays still do not produce a smooth continuous scrolling background. Is there something else I need to do to make it appear to continuously scroll ?

TweenMax.to(".test", 1, {backgroundPosition:"-80px 0px", repeat:-1, easeIn : Linear});

See the Pen fecb4a95e3d47ae44b44c67ef4ae7ee4 by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Can you provide a Codepen that exhibits this pause so we can see what you are seeing? I modified that GreenSock pen and couldn't see any pause.

TweenMax.to(".test", 4, {backgroundPosition:"-80px 0px", repeat:-1, ease:Linear.easeNone});

easeIn is not a recognised easing property of GSAP, and the Linear class on it's own doesn't create an ease. You need to define eases using the syntax ease:Class.type e.g.

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