In this paper, a novel time-varying gain extended state observer (ESO)-based moving sliding mode control method is proposed for anti-sway and positioning control of two-dimensional underactuated overhead cranes. The designed moving sliding mode surface can adjust its slope in real time according to the state variable errors; in addition, a dynamic exponential term is added into the moving sliding mode surface so as to drive any initial state variable errors into the sliding surface rapidly, and thereby the robustness of crane systems is improved. Then, a chattering-free reaching law is designed to realize fast convergence of the system state errors, and the input is modelled as a saturated one due to the fact the motor torque is bounded and the control law and adaptive updating law of switching gain are derived in the sense of Lyapunov function, so the stability can be guaranteed even under the input saturation. Moreover, to suppress the matched and unmatched disturbance occurring in crane dynamic systems, a time-varying gain ESO is constructed to estimate the lumped disturbance, then the estimated value is used for feedforward compensation to establish the controller. Finally, the simulation results confirm the effectiveness of the proposed controller.