Jump to content
Search Community

Search the Community

Showing results for tags 'tweenlite fromto scrollTo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

Found 1 result

  1. Hi everyone I am implementing a simple smooth scrolling to next section type of thing. Here is the code: $('a.next-section').click(function(){ scrollTop = $(window).scrollTop(); $('h1').each(function(i, h1){ // loop through article headings h1top = $(h1).offset().top; // get article heading top if (scrollTop<h1top) { // compare if document is below heading TweenLite.to(window, 0.5, {scrollTo:{y:h1top}, ease:Power2.easeOut}); return false; // exit function } }); }); As it is, it scrolls to the next section, but starts from the TOP of the page most of the time - obviously I want it to scroll from the current window position to avoid the nasty 'massive jump' effect. I have tried: TweenLite.fromTo(window, 0.5, {y:window.y}, {scrollTo:{y:h1top}, ease:Power2.easeOut}); where 'window.y' is the current Y position of window (correct??) I have also tried for the "from" part: {y:$(window).scrollTop()} (or the "scrollTop" variable which is the same thing) It does the same thing... what am I missing? It seems pretty simple... Can anybody help me? Thanks a lot (I'm learning)!
×
×
  • Create New...