This is a subtle one. Hanging is used to mean either suspended, supported, executed or not moving (and probably more). You can hang on, onto, off, out, out of, from or in something (and probably more).
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
UltimatePedantIn this instance, I would say "on a tree" implies supported and "from a tree" implies suspended.That is too subtle for me. I find the two phrases synonymous.