The one-dimensional photonic-crystal (A/SiO2)6/ZnO/(SiO2/A)6 resonators at visible lights are fabricated and characterized, where A may be ZnO or indium tin oxide. Owing to the absorption of ultraviolet (UV) light by the ZnO layers, the refractive index of ZnO layers is changed temporally. This fact led to a temporary shifting of the forbidden band and the resonant mode of the resonator under UV irradiation. Besides, via adjusting the thickness of the ZnO defect layer, the resonant wavelength is manipulated. These experimental data show good consistence with simulated results.