JS Prank 2

HTML

<!-- start slipsum code -->

<p>Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. </p>

<p>The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. </p>

<p>The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. </p>

<p>Look, just because I don't be givin' no man a foot massage don't make it right for Marsellus to throw Antwone into a glass motherfuckin' house, fuckin' up the way the nigger talks. Motherfucker do that shit to me, he better paralyze my ass, 'cause I'll kill the motherfucker, know what I'm sayin'? </p>

<p>Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong...

CSS

body{
    padding:30px;
    font-family:arial;
    background:#eeeeee;
}
p{
    color: #333;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 20px;
    text-shadow:0 1px 0 #fff;
}

JavaScript

function fakeDeath(){

    // Add Black Element
    $('<div />', {
        id:'pranklet'
    }).css({
        position:'fixed',
        zIndex:'9999',
        background:'#000',
        width:'100%',
        height:'100%',
        top:0,
        left:0,
        opacity:0
    }).prependTo('body');
    
    $blanket = $('#pranklet');
    
    // Begin Flicker
    $blanket
    .animate({opacity:1}, 200)
    .animate({opacity:0}, 100)
    .animate({opacity:1}, 10)
    .animate({opacity:0}, 10)
    .animate({opacity:1}, 10)
    .animate({opacity:0}, 50)
    .animate({opacity:1}, 100, function(){ // Callback Function so we can do shit other than animate
        
        // Flip the page? Why not. Save original height as this can screw things up.
        var originalHeight = $('body').height();
        $('body').css({
            '-webkit-transform': 'rotate(180deg) !important',
            '-moz-transform': 'rotate(180deg) !important'
        });
        
        // Scroll to the bottom so it appears we're still at the top (the page is just flipped)
        window.scrollTo(0,$('body').height() - window.innerHeight);
        
        // Pause, then continue flickering
        setTimeout(function(){
            $blanket
            .animate({opacity:0}, 40)
            .animate({opacity:1}, 100)
            .animate({opacity:0}, 10)
            .animate({opacity:1}, 10)
            .animate({opacity:0}, 10)
            .animate({opacity:1}, 50)
            .animate({opacity:0}, 100)
            
            
            .animate({opacity:1}, 1000)
            .animate({opacity:0}, 10)
            .animate({opacity:1}, 2000, function(){ // Mo shit
                
                // Go back to the real top, thanks.
                window.scrollTo(0,0);
                
                // Flip the page back, that helps.
                $('body').css({
                    '-webkit-transform': 'rotate(0deg) !important',
                    '-moz-transform': 'rotate(0deg)...