That "leg over" thing

I originally posted this a few days ago, but no reply, so giving it another go:
"Getting a leg over", meaning having sexual relations, is nice and visual -- but when did the phrase originate?

Replies