Jump to content
Search Community

Can't get scrollTo plugin to target IDs

mbader 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'm trying to get the scrollTo plugin to work without any luck in targeting element IDs. Have tried this in several scenarios. For example:

	var downBtn = $('#history-banner-down-btn');

	downBtn.on('click',function() {
	  TweenMax.to($(window),1,{scrollTo:{y:'#section-1',offsetY:85}});
	});

This will work if I change '#section-1' to 'max' which scrolls to the bottom of the document. Using an ID never works - no console errors or anything. Any ideas on where I'm going wrong?

 

RESOLVED:

Almost immediately fixed the problem after posting this. I was using an older version of the scrollTo plugin. Updated to 1.8 and it worked.

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