This applet demonstrates how the wavefunction of a particle - say an electron - develops in time as it passes through the two slits in an interference experiment. Actually, what is shown is the square magnitude of the wavefunction, the wavefunction itself is a complex valued function. The square magnitude is always positive, and is proportional to the probability of finding the particle at a particular point.
Remember that the electron itself is a very small particle, less in size than the size of a point (a pixel) in the figure. However, the "wavefunction" associated with the particle typically may extend over a scale of tens of nanometers. At any time, the square magnitude of the wavefunction plotted in the figure would be proportional to the probability of detecting the particle at that point, if the whole plane was covered with electron detectors which would be activated at that instant in time. Only one of those detectors would then "click", with the corresponding probability. The wavefunction will then instantly lose its meaning and is said to "collapse".
The randomness in the detection process is inherent in nature, and cannot be avoided. If, for example, one tries to make the initial form of the wavefunction confined to a very small part of space to decrease the uncertainty in the position of the electron, this form will rapidly disperse due to uncertainties in the velocity.
In the applet, the detectors are placed at the extreme left and right sides of the simulation region, so that the detection can take place only after an appreciable part of the wavefunction reaches these regions. The detectors are continuously active, but just when and which one of them will "click" will be random and will depend on how much of the probability has been absorbed by the detectors. The probability current, or "flux" entering the detectors is indicated by the white graphs at those positions.
The wavefunction itself develops in time according to the time dependent Schroedinger equation under the influence of the potentials, which in this case consists of a barrier region with two slits. The wavefunction will pass through both slits, and will recombine on the other side. The two branches of the wave will interfere with one another - constructively at certain places, destructively at others. The effects of the interference is apparent in the graphs of the probability flux. The instant one of the detectors detects the electron, the wavefunction collapses.
How the electron itself moves (whether it passes through one of the slits or both - or how the wavefunction is related to the actual electron) is a question that is not well defined in quantum mechanics - some would say that it is not a valid question. A good place to start reading about such aspects of quantum mechanics is the article F. Laloe, Am. J. Phys. 69, 655 (2001).
Closing one of the slits removes the interference effects. (You can change the sizes of the slits while the wavefunction is developing. The resulting probability distribution will show the interference effects only when both slits are open.) You can also move the detectors closer to the slits to identify through which hole the electron passes through. But in that case, the process becomes similar to having the sum of the effect of the individual slits being open one at a time. In particular, the strong constructive interference at the center disappears.
The shooting up of the wavefunction when it hits the barrier at the center is due to the sharpness of the potential. In a real physical system, the potentials would be smoothed out into ramps, and the process would look less cataclysmic.
"Measure what is measurable, and make measurable what is not so."
Galileo Galilei, Quoted in I Gordonand and S Sorkin, The Armchair Science Reader (New York 1959).