The photon CAN transfer part of its energy to the electron and continue to exist. An example of this is Compton scattering, where a gamma ray transfers enough energy to the electron to ionize and move it out of the atom's potential well, but my question is about electronic transitions in the visible spectrum.