Here's the story (paraphrased) from (Stillman 2008, 196-198):
After completing the transcontinental railroad in 1869, the financier Leland Stanford was burnt out and his doctor advised him to spend time outside and with horses. Stanford got involved in the racehorse industry and became intrigued with the popular question of whether or not when a horse galloped, there was a point at which all four of its legs were off the ground. Stanford sided with those who said there was indeed such a moment, but there were plenty others who argued that a horse would collapse without the support of at least one leg. According to legend, Stanford placed a twenty-five thousand dollar bet that horses do in fact become completely airborne at some time during the gallop, and he convinced the landscape photographer Eadweard Muybridge to rig up an experiment that would show once and for all that horses do in fact leave the ground completely in the gallop.
On a June morning in 1878, racing fans and reporters gathered at Stanford's estate to watch the demonstration Muybridge had prepared. The first horse they used was the trotter Abe Edgington. Muybridge had set up twelve wires under the track at twenty-one-inch intervals, each connected to a camera. The horse was pulling a sulky, and as the sulky wheels ran across the wires, the shutters were tripped and twelve photographs were produced. As Stanford expected, the horse did leave the ground, even at just a fast trot. The experiment was later conducted with Stanford's horse Occident carrying a jockey at the gallop and the same results were recorded.
Stillman, Deanne. 2008. Mustang: The Saga of the Wild Horse in the American West. Boston and New York: Houghton Mifflin Company.