mrbulle's snippets

Avoid class researches or precise them.

//You should not use 
$(".bob").hide();

//but use instead
$("#closestParent .bob, #someOtherPlaceNearBob .bob").hide();

Only one search for many applications

// You shouldn't use :
$(".bob").css("top","24px");// Search for bob, then css application
$(".bob").animate({top:0});// Search for bob, then animat application
$(".bob").hide();// Search for bob, then hide application

// But use instead :
$(".bob").css("top","24px").animate({top:0}).hide();// Search for bob, then do all those things with the same guy. Only one research