This is all as a result of the sensory. It is because of the brain communicating to the nerves which makes the eyes to go side to side very fast. See more details at en.wikipedia.org/wiki/Eye_movement_(sensory).
Be careful nystagmus can be the sign of many things wrong either cerebral hemisphere, vestibular or with lesion of afferent neural pathway. Seizure, visual disturbance, cochlear problems(like vertigo) you need to follow up with an ophthalmologist to find the root of the problem could be minor or major but because of the plethora of problems linked to this symptom you'll need some differential diagnostics.