Take another look at the sentence:
Dangling his legs over the water, Tommy sat on
the pier and cried. Infused with his
great sadness, the tears hit the waves and attracted Marina, a beautiful
mermaid. Popping out of the ocean as sleek as a seal, Tommy gasped at the
sight. While Marina’s tail flopped against the wood, which was long, scaly,
and metallic blue, she asked poor Tommy the reason for his pain. Tommy explained
that he had lost the surfing championship, which included a scholarship
to college. Assessing his set as clumsy and inelegant, not a single compliment
was received from the judges. After Tommy bemoaned his ineptitude on a surfboard,
Marina made a proposal: She would turn him into a merman with the grace
and athleticism of a dolphin! Wielding ancient ocean secrets with a snap
of her fingers, a metallic green tail replaced Tommy’s legs! Diving into
the waves, the tail propelled Tommy through the strong surf. Ecstatic about
his new abilities, the training and advice Marina offered went unheeded.
Refusing to use conditioner, for example, the sun and salt water soon damaged
Tommy’s hair, which became dry and brittle. A dangerous and foolhardy activity,
Tommy also insisted on head bumping the Great White sharks that he encountered.
Putting straws up his nose and barking like a walrus did not make Tommy
popular when he had dinner with Neptune, Marina’s father. After thoughtlessly
scrambling endangered sea turtle eggs for breakfast, an apology had to be
made not only to Marina but also to the grieving reptile mother. One day
out on a swim, Tommy drank a root beer and tossed the empty plastic bottle
in the water. Polluting the ocean so carelessly was the last clam shell
for Marina. With an angry snap of her fingers, she replaced Tommy’s tail
with two human legs. Sinking under the waves, Tommy’s legs finally kicked
him to the surface where he gulped a much needed breath of air. Saying a
curt goodbye, Marina’s tail slapped the surface dismissively as she dove
into the ocean depths. While swimming the mile back to shore as a regular
human being, Tommy regretted the gift that he had squandered.
No error exists. Dangling his legs over the water, a participle phrase, comes right before Tommy. Since Tommy is the one dangling his legs, this modifier is in the right place.