If you would measure the electron at one of the slits, then the interference patterns would no longer be formed. That is because the pattern is produced by interference of an electron amplitudes diffraction from slits 1 and 2. If you know that electron is at slit 1, it is of course no longer at slit 2, and therefore you wouldn't get the interference pattern.
The measuring at slits could be called wave function collapse, but I would rather talk about quantum entanglement with environment. Let's say we have two slit states $\left|1\right>$ and $\left|2\right>$, which describe electron being at slits 1 and 2 respectively. Let's also say that we have two already diffracted states at the detected (whatever device used to measure the interference pattern) $\left|1'\right>$ and $\left|2'\right>$. The electrons propagate from the slit states to detector states in trivial manner, so that $\left|1\right>$ becomes $\left|1'\right>$ and $\left|2\right>$ becomes $\left|2'\right>$ as the electrons travel.
The initial wave function is $\left|1\right>+\left|2\right>$, and therefore the interference pattern is $\left|1'\right>+\left|2'\right>$.
Now, let's define environment states $\left|M1\right>$ and $\left|M2\right>$, which are corresponding the magnetic measurement system saying BEEP or BLIIP as the electron passes through slit 1 or slit 2.
If we hear BEEP, we know that our system is in state $\left|1\right>\left|M1\right>$, and if we hear BLIIP we know that our system is in state $\left|2\right>\left|M2\right>$. As the electron is only in either on of these two states, the electron will travel to the measurement device resulting into $\left|1'\right>\left|M1'\right>$ and $\left|2'\right>\left|M2'\right>$ respectively. Therefore the interference pattern vanishes.
If you believe in many worlds theory, you can even say that the world is in $\left|1\right>\left|M1\right> + \left|2\right>\left|M2\right>$ state, and then the electron travels to measuring device and the world is in $\left|1'\right>\left|M1'\right> + \left|2'\right>\left|M2'\right>$. But if you hear BEEP you are trapped in universe $M1'$ forever, and if you hear BLIIP you are trapped to $M2$ respectively.
If you don't measure the electrons at slits at all, you will encounter a wave function like $\big(\left|1'\right> + \left|2'\right>\big) \left|M\right>$, and you can then measure the interference pattern.