Permalink
Browse files

infinte scrolling vertical jcarousel

  • Loading branch information...
1 parent 66c9ab9 commit b5f8a1536f915b6e8a416589c732b2a47aa10513 @stevenwilkin committed Aug 23, 2009
Showing with 29 additions and 0 deletions.
  1. +22 −0 public/js/trends.js
  2. +7 −0 views/trends.sass
View
@@ -1,2 +1,24 @@
+function itemVisibleIn(carousel, item, i, state, evt){
+ var idx = carousel.index(i, $('#images ol li').length);
+ var h = $($('#images li')[idx - 1]).html();
+ carousel.add(i, h);
+}
+
+function itemVisibleOut(carousel, item, i, state, evt){
+ carousel.remove(i);
+}
+
$(document).ready(function(){
+ $('#images ol').hide();
+ $('#images').append('<ul id="carousel" class="jcarousel-skin-tango">');
+ $('#carousel').jcarousel({
+ vertical: true,
+ scroll: 1,
+ auto: 1,
+ buttonNextHTML: null,
+ buttonPrevHTML: null,
+ wrap: 'circular',
+ itemVisibleInCallback: {onBeforeAnimation: itemVisibleIn},
+ itemVisibleOutCallback: {onAfterAnimation: itemVisibleOut}
+ });
});
View
@@ -66,9 +66,16 @@ a
background = !white
padding: 5px 10px
float: right
+ width: 125px
height: 400px
overflow: hidden
img
display: block
margin: 0 auto
+
+ li,
+ a
+ width: 125px
+ height: 100px
+ overflow: hidden

0 comments on commit b5f8a15

Please sign in to comment.