A pulley device for smooth sliding of sliding doors or sliding windows, comprising: a pulley component comprising a pulley; a connecting component comprising a rocker , one end of the rocker being rotatably connected to the pulley component ; and a housing comprising a bottom plate and two side plates , the two side plates being fixed to two opposed sides of the bottom plate , respectively, so that the bottom plate and the side plates jointly define a receiving cavity configured to receive the pulley component and the connecting component , wherein a surface of the side plate facing the receiving cavity defines a receiving groove along a length direction of the side plate , and the other end of the rocker is received in the receiving groove and is capable of sliding along the receiving groove ; wherein the side plate further defines a guiding groove , an extending direction of the guiding groove is not parallel to an extending direction of the receiving groove ; the connecting component further comprises a positioning pin , the rocker defines a positioning hole ; the positioning pin extends through the positioning hole ; one end of the positioning pin is received in the guiding groove so that the positioning pin is capable of sliding along the guiding groove and guiding the rocker ; wherein from an end adjacent to the bottom plate to an end far away from the bottom plate , the two side plates each comprises a first plate body and a second plate body ; the receiving groove is located on the first plate body , and the guiding groove is located on the second plate body ; wherein a distance between two opposed first plate bodies is less than a distance between two opposed second plate bodies . a pulley component comprising a pulley; a connecting component comprising a rocker , one end of the rocker being rotatably connected to the pulley component ; and a housing comprising a bottom plate and two side plates , the two side plates being fixed to two opposed sides of the bottom plate , respectively, so that the bottom plate and the side plates jointly define a receiving cavity configured to receive the pulley component and the connecting component , wherein a surface of the side plate facing the receiving cavity defines a receiving groove along a length direction of the side plate , and the other end of the rocker is received in the receiving groove and is capable of sliding along the receiving groove ; wherein the side plate further defines a guiding groove , an extending direction of the guiding groove is not parallel to an extending direction of the receiving groove ; the connecting component further comprises a positioning pin , the rocker defines a positioning hole ; the positioning pin extends through the positioning hole ; one end of the positioning pin is received in the guiding groove so that the positioning pin is capable of sliding along the guiding groove and guiding the rocker ; wherein from an end adjacent to the bottom plate to an end far away from the bottom plate , the two side plates each comprises a first plate body and a second plate body ; the receiving groove is located on the first plate body , and the guiding groove is located on the second plate body ; wherein a distance between two opposed first plate bodies is less than a distance between two opposed second plate bodies . <EOS>