0

My question has been partly answered in this thread - Show Div when scroll position, but I would like to know:

1)How to show and hide the Div based on scrolling up or down. A specific example is this website which shows/hids the Div based on scrolling up or down and also has them fade in from the left or right - http://bit.ly/1lOZXRY.

2) How do you achieve the effect of automatically scrolling down the website like a story is being told when you click "Click here to read the story..."?

Thanks you :)

Community
  • 1
  • 1
Beccas
  • 85
  • 1
  • 2
  • 7
  • Use the previous scroll position against the new scroll position to determine if it is a negative or positive number. Negative means scrolling up (towards top of the page from the bottom), positive means scrolling down from top to bottom. – user887515 Apr 11 '14 at 22:07
  • Thanks for your help user887515. What about the fade in and fade out effects from the left and right, and the automatic scrolling? – Beccas Apr 11 '14 at 22:40

1 Answers1

1

There is a Jquery plugin doing what you want Scrollmagic

One example do exactly what you wanted anchor link To change the scroll duration just change the tweenmax

TweenMax.to(window, 2.5, {scrollTo: {y: $elem.offset().top}}); //line 79
Core972
  • 3,715
  • 3
  • 28
  • 39