What makes an electron to change the direction after passing through the slit?
The interaction between the electron and the particles (atoms) making up the slit.
It is the idea that electrons also exhibit a form of wave-particle duality. Similar to how you can calculate the wavelength of light with the equation wavelength=h/momentum, you can just plug in the momentum of a particle to get its "de Broglie" wavelength which seems hand wavey but it is real. So this electron has a de Broglie wavelength and because of that behaves like a wave in this experiment just like photons do.
Vanhees71, you mean that
Thanks very much. Does this means the electron oscillates as it travels through space? It does not move straight?
The notion that waves oscillate through space is misguided. For example, if I shake a string and there are waves, nothing is really oscillating through space. A photon, although a particle, is not waving through space. The strengths of the electric and magnetic field are increasing and decreasing simulating a wave. Look at this image: https://xphysxcom2016.files.wordpress.com/2016/05/asd.png?w=1995. This shows that the photon is just a periodic increase and decrease in the electric and magnetic fields. Similarly, the electron does not oscillate. The electron's wave, if I am not mistaken, is more closely related to a probability wave. The square of its magnitude would give the probability of being at any specific position but this delves into the heart of quantum mechanics. Note that earlier I stated how wavelength can be calculated by h/momentum. Well all objects have momentum! So all objects have deBroglie wavelength and hence behave like waves. However, the momentum of objects in our everyday world have such large momentum compared to that of individual photons and particles that the wavelengths become immensely small. This means the wave nature of you and me is impossible to notice and we can practically be treated as solid objects. The important thing to take away is that there is no oscillation, it simply behaves like a wave, a property that is fundamental to everything in our universe.
No, to the contrary! I disagree with the statement that there is wave-particle duality. This is an outdated picture for more than 90 years now and doesn't help in understanding modern quantum theory.
How about this answer:
The position of the electron becomes less uncertain - the electron could be found somewhere in the slit. That causes the momentum of the electron to become quite uncertain. In this case the direction of the momentum vector changes or 'changes', not the magnitude of the vector.
Separate names with a comma.