Skip to content

Instantly share code, notes, and snippets.

@nmanzi
Created August 24, 2009 05:28
Show Gist options
  • Save nmanzi/173676 to your computer and use it in GitHub Desktop.
Save nmanzi/173676 to your computer and use it in GitHub Desktop.
Shatner Roll code as used on RailsRumble '09 website.
hasRumbling = false
shatnerLoaded = false;
function stillRumbling()
{
if(hasRumbling) return;
if(!shatnerLoaded) {
$(new Image()).load(function() {
shatnerLoaded = true;
stillRumbling();
}).attr('src', '/images/still-rumbling.png');
return;
}
var topHeight = 321;
var c = $("<div />").css({
width: 527,
height: 0,
background: 'url(/images/still-rumbling.png) top center',
position: 'fixed',
bottom: 0,
right: 0,
"z-index": 1000,
cursor: 'pointer'
}).appendTo($("body"));
c.show().animate({
height: 371
}, 1500).click(function() {
var i = $(this);
$(this).animate({height: 0}, 1500, function() { i.remove(); hasRumbling = false; });
});
hasRumbling = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment