Answer by
Clement (1453)
This phrase comes of the railroad jargon, its original meaning was "to go at high speed". Jack, abbreviated from "jackass carrying the load", was a common name for a locomotive. Balling presumably referred to the hand gestures of the trainmen. Later on this phrase was transferred to dancing and having good time in general.