Within the framework of the Lanzhou quantum molecular dynamics (LQMD) transport model, the isospin effect in peripheral heavy-ion collisions has been investigated thoroughly. A coalescence approach is used for recognizing the primary fragments formed in nucleus-nucleus collisions. The secondary decay process of the fragments is described by the statistical code, GEMINI. Production mechanism and isospin effect of the projectile-like and target-like fragments are analyzed with the combined approach. It is found that the isospin migration from the high-isospin density to the low-density matter takes place in the neutron-rich nuclear reactions, i.e., $^{48}$Ca+$^{208}$Pb, $^{86}$Kr+$^{48}$Ca/$^{208}$Pb/$^{124}$Sn, $^{136}$Xe+$^{208}$Pb, $^{124}$Sn+$^{124}$Sn and $^{136}$Xe+$^{136}$Xe. A hard symmetry energy is available for creating the neutron-rich fragments, in particular in the medium-mass region. The isospin effect of the neutron to proton (n/p) ratio of the complex fragments is reduced once including the secondary decay process. However, a soft symmetry energy enhances the n/p ratio of the light particles, in particular at the kinetic energies above 15 MeV/nucleon.