Function jQuery.swap() optimized.