A sliding device configured in a portable electrical apparatus includes a main base fixed to a main housing of the portable electrical apparatus, a sliding base fixed to a sub-housing of the portable electrical apparatus, a guiding portion coupled to the main base and the sliding base for limiting a sliding range and an elastic module arranged between the main base and the sliding base. The elastic module includes a first rotator located on the sliding base, a second rotator located on the main base, a sliding bar passed through a compression spring and arranged between the first rotator and the second rotator. When the sub-housing slides on the main housing to achieve a critical level, the sliding force accumulated in the compression spring is maximized. Therefore the sub-housing is advanced by sliding force released from the compression spring.