A sliding inflator with inner and outer cylinders is provided. The outer cylinder has a fixing element with an axial pipe protruding therefrom and having two through holes. A rotating element is disposed around the axial pipe and has two receiving chambers matching the through holes, respectively, and receiving a ball each. A gradually-deepened curved portion of the receiving chamber is defined between shallow and deep ends thereof. The rotating element rotates between an unlocked position and a locked position. A stopping element is fixed to the inner cylinder and has a protruding post with an annular groove. The rotating element switches from the unlocked position to the locked position to couple the cylinders together, and switches from the locked position to the unlocked position to release engagement between the cylinders.