Created
January 25, 2011 15:35
-
-
Save fleeting/795076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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