Dynamic structure factor of fractals