A camera module comprises a base, a lens joined to the base, a frame
movably disposed on the base, an image detecting unit fixed to the frame
and moving on the base via the frame, and a solenoid having a post moving
between a first position and a second position. When the image detecting
unit moves on the base via the frame, the post is in the first position
and has no contact with the image detecting unit. When the image
detecting unit moves on the base not via the frame, the post is in the
second position and abuts the image detecting unit to position the image
detecting unit.