In this paper, a nonlinear suboptimal control law is presented for overhead cranes. The integrated quadratic performance index is minimized in the control law. Since the Hamilton-Jacobi-Bellman equation of nonlinear system is quite difficult to be solved, $\theta-D$ method is used to obtain the approximate solution without complicated online computations. Moreover, the external wind and friction that the crane suffers are treated as lumped disturbance. Feedforward compensation based on a nonlin-ear disturbance observer (NDOB) is introduced to restrain the disturbance. Based on the $\theta-D$ method and NDOB, a suboptimal composite controller is proposed to guarantees the asymptotic stability of crane system in the presence of the disturbance whose amplitude tends to constant when time goes to infinity. Rigorous proof and stability analysis are presented based on Lyapunov analysis. Simulation results show the effectiveness of proposed controller.