Skip to content

Instantly share code, notes, and snippets.

@fleeting
Created January 25, 2011 15:35
Show Gist options
  • Save fleeting/795076 to your computer and use it in GitHub Desktop.
Save fleeting/795076 to your computer and use it in GitHub Desktop.
var animateDelay = 0;
var animationDelay = 2350;
function slideImage() {
$("#slider .currentSlide").removeClass("currentSlide").next().addClass("currentSlide").parent().find('li:first-child').animate({
width: "0px"
}, 2500, function() {
li = $(this).detach();
li.width("960").find("img").css("margin", "0px");
li.appendTo("#slider");
parallaxGo();
});
}
function parallaxGo() {
$("#slider .currentSlide .bottom").delay(animateDelay).animate({
marginLeft: $("#slider .currentSlide .bottom").attr("rel")
}, animationDelay, "easeOutQuad");
$("#slider .currentSlide .middle").delay(animateDelay).animate({
marginLeft: $("#slider .currentSlide .middle").attr("rel")
}, animationDelay, "easeOutQuad");
$("#slider .currentSlide .top").delay(animateDelay).animate({
marginLeft: $("#slider .currentSlide .top").attr("rel")
}, animationDelay, "easeOutQuad");
}
$(document).ready(function() {
setInterval("slideImage()", 5700);
parallaxGo();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment