In ancient times there was a man called Ye Gong who was very fond of dragons. In his home everything, including the walls, windows, doors and even articles of daily use, were decorated with dragon designs. A real dragon was quite impressed when it heard about this, so it went to visit Ye Gong. However, when it stuck its head through the window Ye Gong was frightened and ran away.
This idiom satirizes those who profess to like or support something, but are averse to it in actual practice.