Permalink
Browse files

fade in people box

  • Loading branch information...
1 parent 570f63b commit 30b7d4724904ecb9bef4f35c1bd898c899cbcee4 @digitaltom digitaltom committed Mar 4, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 js/hackweek.js
View
@@ -88,9 +88,16 @@ $(function () {
});
}
+ /* people page text scroll animation */
+ if ($(window).scrollTop() > $('#people').position().top - $('#people').height() &&
+ $(window).scrollTop() < $('#people').position().top + 2 * $('#people').height()) {
+ var percent_scrolled_out = Math.abs(($(window).scrollTop() - $('#people').position().top) / $('#people').height())
+ $('.project-instructions').css({'opacity': 1 - percent_scrolled_out * 3})
+ }
+
/* where page text scroll animation */
- if ($(window).scrollTop() > $('#projects').position().top) {
- var percent_scrolled_out = -($(window).scrollTop() - $('#where').position().top) / $('#where').height()
+ if ($(window).scrollTop() > $('#where').position().top - $('#where').height()) {
+ var percent_scrolled_out = Math.abs(($(window).scrollTop() - $('#where').position().top) / $('#where').height())
$('#where-title').css({'opacity': 1 - percent_scrolled_out/2,
right: percent_scrolled_out * -500})
}

0 comments on commit 30b7d47

Please sign in to comment.