Chemical reactions subjected to time-varying external forces cannot generally be described through a fixed bottleneck near the transition-state barrier or dividing surface. A naive dividing surface attached to the instantaneous, but moving, barrier top also fails to be recrossing-free. We construct a moving dividing surface in phase space over a transition-state trajectory. This surface is recrossing-free for both Hamiltonian and dissipative dynamics. This is confirmed even for strongly anharmonic barriers using simulation. The power of transition-state theory is thereby applicable to chemical reactions and other activated processes even when the bottlenecks are time dependent and move across space.