This is a random list of jQuery code that roughly reflects real life.

Follow me on twitter @reallifejquery Follow reallifejquery on Twitter


Monday, May 31, 2010

Missed a blog post?

var requiredsleep = 1000 * 60 * 60 * 12;
$('#yesterday').blur();
$('.body').error(function() {
   $('#consciousness').fadeOut().delay(requiredsleep).fadeIn();
   $('#yesterday .blogentry').add();
   $('#today .blogentry').add();
});

Police work

$('.crime').stop();
if ($('#criminal .crimes').prev().prev()) {
   // Third strike
   $('#criminal').appendTo('#jail');
}
else {
   // Let them go with a warning
   $('#criminal .mindset').toggle();
}

Saturday, May 29, 2010

Packing your suitcase

$('#clothes').each().effect('fold');
$('#shoes').each().add('socks'); // so the shoes keep their shape
$('#suitcase').add(document.getElementById('clothes'));
$('#suitcase').add(document.getElementById('toiletries'));
$('#suitcase').add(document.getElementById('shoes'));
$('#suitcase .zip').scroll();

Friday, May 28, 2010

A visit to the chiropractor

$('body #back .pain').show();
$('body #back').click().click().click().dblclick();
$('body #back .pain').hide();

Thursday, May 27, 2010

Chicken Burrito with jQuery

$('#chicken').slice(8);
$('#chicken').add('marinade').delay(2000);
$('#chicken').add('.salsa').add('.guacamole').add('.jalapenos');
$('.ingredients').wrap('tortilla');

Wednesday, May 26, 2010

Regardless of the day ahead, coffee is needed.

if ($(self).has('.work')) $(self).find('.coffee').first();
else if ($(self).has('.chores')) $(self).find('.coffee').first();
else $('.friends').join('#cafe');

Tuesday, May 25, 2010

Dealing with an oil spill is easy with jQuery

$('#well').append('sealingdome');
$('.water').remove('.oil');

Monday, May 24, 2010

Man vs. Nature

// Realistic
$('#volcano').show('explode');
$('.flights').delay(800).delay(800).delay(800).remove();

// Optimistic
$('.flights').replaceWith('trains, busses, boats');
$('.complaints').trigger('change');

Sunday, May 23, 2010

Hide and go seek with jQuery

$('#seeker').delay(100);
$('.friends').hide();
$('.friends').each(function() {
   $('#seeker').find(this).show();
})

Saturday, May 22, 2010

Robbing a bank

$(self).load('gun');
$('#bank').find();
$('.money').remove();
$('.cops').effect('shake');

Friday, May 21, 2010

jQuery approach to sex

$('#mypartner').focus(function() {
   $('#mypartner').andSelf().remove('.clothes');
   $('#me').find('#mypartner .clitoris').wrap('tongue');
   $('#me .penis').animate({
      height: '+=100%,
      width: '+=100%'
   });
   $('#mypartner').nextUntil('.orgasm').slideUp().slideDown();
   $('#me .penis').unload(function() {
         $('#me .penis').remove();
         $('#mypartner').andSelf().fadeOut();
      });
   });
});

Thursday, May 20, 2010

jQuery sayings

$('.ladies').first();
$('#age').before('#beauty');
$('#godliness').next('#cleanliness');
alert($('.blessings').size());
$(self).delay(999999).add('.goodthings');
$(':not(visible)').each(function() {
 $('#mind').remove($(this));
});
if ($('.wheel .squeaky')) $('#grease').get();

// And a couple of cheaty ones that I couldn't resist...
$(self).live('sword', function () { die('sword'); });
$(self).animate({
 haste: +100,
 speed: -100
});

Wednesday, May 19, 2010

jQuery Haiku

$(self).animate({
   opacity: .01});
$(self).has('#disguise');

Tuesday, May 18, 2010

How mice affect our lives

$('#MyHouse').mouseenter(function () {
   $('.cheese').slice(2);
   $('.mousetrap').add('.cheese');
   $('.mousetrap').position();
   $('.mousetrap #armed').toggle();
   $('.mousetrap').click(function() {
      if ($('.mousetrap').has('.mouse')) {
         $(this).remove('.mouse');
      }
      else if (!$('.mousetrap').has('.cheese')) {
         $('.cheese').slice(2);
         $('.mousetrap').add('.cheese');
      }
      $('.mousetrap #armed').toggle();
   });
});


$('#MyHouse').mouseleave(function () {
   $('.mousetrap').remove();
});

Monday, May 17, 2010

Hacking For Dummies

$('.employeeemails').append($('#trojan')).ready(function() {
   $(self).add('#rootaccess');
   $('#data .sensitive').clone().appendTo('#myserver');
   $('.logs .tracesofme').removeData();
});

Sunday, May 16, 2010

A day in the life of a hummingbird

$('.flower:contains("Sugar")').hover(
   function() {
      $(this).empty();
   }),
   function() {
      $('.flower').next().focus();
   });
});

Saturday, May 15, 2010

Our relationship was never like this before...

$('#feelings #partner').change(function() {
   if ($('#feelings #partner').val()>$('#feelings #partner').before().val())
   {
      $('#love').show();
   }
   else if ($('.someoneelse').has('interest'))
   {
      $('#partner').replaceWith('.someoneelse');
   }
   else
   {
      $('#facebook_relationship_status').toggle();
   }
});

Friday, May 14, 2010

Inside the mind of a serial killer

$('#reality').detach();

while (1)
{
   $('#victim').select(function() {
      if (!$('.witness').attr('visible')) {
         $('#victim').slice(16);
         $('#victim').die();
         $('#victim .bodyparts :visible').hide();
      }
   });
}

Thursday, May 13, 2010

I just met someone and there was chemistry!

$('.stranger').click(function() {
   {
      if ($(self).hasClass()) date();
      else $('#boundaries').blur();
   }
});

What sort of person are you?

// Eliteist
if ($(self).getClass() != $('.otherpeople').getClass()) {

   return false;
}
else return true;

// Snob
if ($(self).getClass() > $('.otherpeople').getClass()) {

   return false;
}
else return true;


// Groupie
if ($('.otherpeople').getClass() > $(self).getClass()) {
   return true;
}
else return false;

// Humanitarian
return true;