Photonic crystals with a complete bandgap can stop the propagation of light of a certain frequency in all directions. We introduce double-inverse-opal photonic crystals (DIOPCs) as a new kind of optical switch. In the DIOPC, a movable, weakly scattering sphere is embedded within each pore of the inverse-opal photonic crystal lattice. Switching between a diffusive reflector and a photonic crystal environment is experimentally demonstrated. Theory shows that a complete bandgap can be realized that can be opened or closed by moving the spheres. This functionality opens up new possibilities for the control of light emission and propagation. The close link and interaction between the chemical synthesis and the computational design and analysis underlines the interdisciplinary focus of this report.