As the front tire reaches the top, weight is transferred forward, ideally moving the body slightly in front of the crank. For continued uphill grinding on a ramp-ledge or series of ledges, the body should be centered over the crank. The biker presses down on the handlebars, "dragging" his weight up to the top of the ledge, so the back wheel is "unloaded."Note that the biker's head is in front of the handlebars.
Note that the body is still back, so the center of gravity is over the rear wheel. Front wheel is popping up, resulting in loss of control.Weight can't be transferred to the front tire, because the arms are "hanging on" due the center of gravity being behind the crank.See that the biker's head is behind the handlebars? He needs to push down on those bars and get his body forward.

Biker approaches log, gets butt off 

seat, positioning body for "rock-back."

At the log: Biker rocks weight back 

sharply just before pulling handlebars up.

Rider pulls front wheel up towards 

chest and onto the log.

Body leans over log, weight is on 

handlebars as rear wheel reaches log.

Keeping weight on hands, rear 

wheel climbs up over log.

Body remains in same position as 

bike rises up under the biker.

Approaching a 12" ledge, aggressive riding position, picking up speed. Note body position relative to vertical line through crank.

Rider rises up tall, shifts body back. The rider has moved back in relation to the crank line -- the center of gravity is between crank and rear wheel.The body is now fully back as the rider pulls up firmly on the handlebars. Front wheel in the air. Rider still pedaling. White lines show butt high off seat, eye to stem distance shortened.

Front wheel touches down, and rider is moving forward. Still pedaling. Rider pushes higher while rear wheel still on ground. Note seat to butt clearance.Rider moves further forward, pushing handlebars down. Eye to stem distance widening. Rider's center of gravity at highest point now.Rider's weight moves still further forward onto handlebars, body begins to angle downward. Rear wheel weightless; rebound may make it leave ground.

Body continues forward and down. The rider's downward motion acts as a lever to "fly" the rear wheel up. The seat is rising up under the rider.Rear wheel hitting the edge. The rider's downward motion is complete. Seat under rider, but still no weight on it. Note tire shows no "bulge" on sharp edge.Attack complete. Rider moves back to original riding position, body comes back up. Still pedaling.