Jump to content
Search Community

Scrolling the page up and down with Greensock JS

ilovemypixels
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

peterPotter
Posted

I just want to stop by and say Thank you very much, Jack, for this ScrollToTop plugin. It has helped me quickly (and beautifully) fix an issue I had on iOS devices with my app.

  • Like 1
  • 4 weeks later...
Guest cogthrob
Posted

Has anyone had issues with scrollTo plugin in IE9? When I try and do something like 

TweenLite.to(window, 2, { scrollTo: { y: 100, x: 0} });

IE9 developer console complains

SCRIPT5: Access is denied.

TweenLite.js, line 766 character 5

which is the isSelector function, so I tried some work around like using a jQuery wrapper for the window but nothing worked.

 

TweenLite does it's job and animates the window down but the javascript block containing the TweenLite call returns so no javascript under the call is run.

 

Just verified this is also happening in IE10.

 

TIA for any insight!  

Posted

Hi and welcome to the forums.
 
Question are you including the scrollTo plugin in your code?, like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.9.8/TweenLite.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.9.8/plugins/ScrollToPlugin.min.js"></script>

With that you also will be using the latest version of the engine.
 
I just tested in IE9 and IE10 a very simple example of the following code:

$(document).ready(function(){

TweenLite.to(window, 2, {scrollTo:{y:300, x:0}});

});

And works fine.
 
If you're including the files could you provide a reduce sample of your issue in a codepen, fiddle or live page to see what's happening?.

 

Hope this helps,

Cheers,

Rodrigo.

  • 1 year later...
Posted

Hi and welcome to the forums.

 

Question are you including the scrollTo plugin in your code?, like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.9.8/TweenLite.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.9.8/plugins/ScrollToPlugin.min.js"></script>

With that you also will be using the latest version of the engine.

 

I just tested in IE9 and IE10 a very simple example of the following code:

$(document).ready(function(){

TweenLite.to(window, 2, {scrollTo:{y:300, x:0}});

});

And works fine.

 

If you're including the files could you provide a reduce sample of your issue in a codepen, fiddle or live page to see what's happening?.

 

Hope this helps,

Cheers,

Rodrigo.

Although your code above works in IE9, 

 

$("#home-button").click(function(e) {
  event.preventDefault();
  TweenLite.to(window, 1, {scrollTo:{y:0}});
});

Doesn't work in IE or Firefox. Any ideas why?

jamiejefferson
Posted

could you provide a reduce sample of your issue in a codepen, fiddle or live page to see what's happening?

 

See the Pen Fmbav by jamiejefferson (@jamiejefferson) on CodePen.

 

You are using two different names for your event which causes javascript to halt. I recommend you check out how to use browser developer tools to debug your pages

 

Chrome

Firefox (or Firebug addon)

Internet Explorer

 

If you open the Console, you'll see the error immediately.

  • Like 1
Posted

Hello longblog, here is a simple working example of GSAP ScrollToPlugin to test with:

 

See the Pen AsLfc by jonathan (@jonathan) on CodePen.

 

Hope it helps? :)

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