Skip to content

Instantly share code, notes, and snippets.

@sophiebits
Created November 10, 2010 03:58
Show Gist options
  • Save sophiebits/670336 to your computer and use it in GitHub Desktop.
Save sophiebits/670336 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$("a.item").click(function(e) {
$(this).addClass("invisible");
setTimeout((function(scope) {
return (function() {
return (function() {
$(this).appendTo(".viewport");
$(this).removeClass("invisible onTop");
$("a.item:first").addClass("onTop");
}).apply(scope, []);
});
})(this), 500);
e.preventDefault();
});
$("a.item:first").addClass("onTop");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment