Permalink
Browse files

scrolling

  • Loading branch information...
1 parent 202df06 commit 0edeb55af85fe55448e631b965dce6d0927c73f7 @timsavery timsavery committed Apr 16, 2012
Showing with 20 additions and 4 deletions.
  1. +9 −2 public/css/style.css
  2. +10 −1 public/js/index.js
  3. +1 −1 views/index/index.jade
View
@@ -13,7 +13,7 @@
}
html{
- overflow: hidden;
+ /*overflow: hidden;*/
}
.clear {
@@ -80,12 +80,19 @@ html {
padding:0 2% 0 2%;
}
+body {
+ height: 100%;
+}
+
.col3 {
width:32%;
- min-height:100%;
+ min-height:100%;
float:left;
border:#ccc 1px solid;
+
+ height: 100%;
+ overflow: auto;
}
.col3:nth-child(2) {
View
@@ -1,5 +1,10 @@
var cardCount;
var currentCard;
+
+var scrollPositions = {
+ geeklist: 0
+};
+
$(document).ready(function() {
cardCount = $('.tile').length;
currentCard = -1;
@@ -14,7 +19,11 @@ function scrollToNextCard() {
var previousCard = '#card-' + (currentCard-1);
var thisCard = '#card-' + currentCard;
- $('html, body').animate({ scrollTop: $(thisCard).offset().top - 100 }, 1000, function() {
+ scrollPositions.geeklist = (currentCard>0)
+ ? scrollPositions.geeklist + $(previousCard).outerHeight(true)
+ : 0;
+
+ $('#geeklist').animate({ scrollTop: scrollPositions.geeklist }, 1000, function() {
$(previousCard).css({ opacity: 0.6 });
$(thisCard).css({ opacity: 1 });
});
View
@@ -1,4 +1,4 @@
-section.col3
+section.col3(id='geeklist')
- each card, idx in geeklistcards
section.tile(id='card-#{idx}', style='opacity:0.6')
img(src='#{card.user.avatar}')

0 comments on commit 0edeb55

Please sign in to comment.