Skip to content

Instantly share code, notes, and snippets.

@rsadwick
Created March 31, 2014 23:18
Show Gist options
  • Save rsadwick/9904534 to your computer and use it in GitHub Desktop.
Save rsadwick/9904534 to your computer and use it in GitHub Desktop.
scrolling items example using greensock
$(document).ready(function(){
var scrollContainer = Gumby.$dom.find("#social-items");
var scrollEl = scrollContainer.find("li");
var padding = parseInt(scrollEl.find(".social-item").css("marginBottom"));
var height = (scrollEl.height() + padding ) * (scrollEl.length - 3);
//create tween:
var socialTween = TweenMax.to(scrollEl, 7, {css:{ top: -height + "px"},
delay: 2, ease:Sine.easeInOut, repeat: -1, repeatDelay: 1, yoyo: true});
//events:
scrollContainer.on("mouseenter", function(){
TweenLite.to(socialTween, .3, {timeScale:0});
});
scrollContainer.on("mouseleave", function(){
TweenLite.to(socialTween, .1, {timeScale:1});
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment