It came from the myth of "The Corpses who Travel a Thousand Miles" (千里行屍), which describes wizards who transport corpses over long distances to hop on their own feet back to their hometown for proper burial.
Some people speculate that hopping corpses were originally smugglers in disguise who wanted to scare off the law enforcement officers.
Jiangshi is also sometimes the Cantonese name for vampire (it is usually translated as xi xie gui or "blood-sucking ghost" in Mandarin). Hence a hopping corpse is also called a Chinese vampire. Chinese vampires were a popular subject in Hong Kong movies during the 1980s; some movies even featured both Chinese vampires and "Western" vampires. In the movies, hopping corpses can be put to sleep by putting a piece of paper with a spell written on it onto their foreheads.
"Gyonshee", a word based on jiangshi, is used in some obscure games and trading card games as a term for creatures that combined the characteristics of Chinese and "Western" vampires.