//graymachine.com - Snap Zoom In/Out
This is a cool expression to use on text. It creates a “snap” zoom on the in and out of the layer by modifying scale.
//Snap zoom in and out: apply to scale
snapScale = 300; //percent of scale to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
inTrans = easeOut(time, inPoint, inPoint + trans, [snapScale,snapScale], [0,0]);
outTrans = easeIn(time, outPoint, outPoint - trans, [0,0], [snapScale, snapScale]);
value+ inTrans + outTrans
If you prefer to use Z space position instead of scale, try this one:
zoom = 5000; //distance to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
inTrans = easeIn(time, inPoint, inPoint + trans, [0,0,zoom], [0,0,0]);
outTrans = easeOut(time, outPoint, outPoint - trans*2, [0,0,0], [0,0,zoom]);
value+ inTrans - outTrans