Dancing mania was a social phenomenon that occurred primarily in mainland Europe between the 14th and 18th centuries; it involved groups of people, sometimes thousands at a time, who danced uncontrollably and bizarrely. Men, women, and children would dance through the streets of towns or cities, sometimes foaming at the mouth until they collapsed from fatigue.
One of the first major outbreaks was in Aachen, Germany, on June 24, 1374; the populace danced wildly through the streets, screaming of visions and hallucinations, and even continued to writhe and twist after they were too exhausted to stand. Having occurred to thousands of people across several centuries, dancing mania was not a local event.
Although no real consensus exists as to what caused the mania, some cases, may have ergot poisoning, known in the Middle Ages as "St. Anthony's Fire". It is caused by eating rye infected with Claviceps purpurea, a small fungus that contains toxic and psychoactive chemicals, including lysergic acid and ergotamine (used in modern times as a precursor in the synthesis of LSD). However, ergotism causes its victims to have visions, not to dance. The fact that large numbers of people were afflicted in mass outbursts that lasted for a few days or weeks at a time suggests that the cause of the dancing-mania phenomenon is more likely to be social than physical
From: http://en.wikipedia.org/wiki/Dancing_mania