Ionic bonding occurs by the passing of electrons between atoms giving rise to stable cations and anions. Notice what happens to the electrons as the atoms approach each other.
Forces in an ionic bond
Two forces are involved in ionic bonding, one attractive and one repulsive. Notice how these forces change depending on the distance between the ions.
Covalent bonding occurs by the sharing of electron pairs between two atoms. Notice what happens to the electrons when the atoms are brought closer together.
Covalent hydrocarbon bonds
This simulation allows us to build hydrocarbon molecules by combining carbon and hydrogen atoms.