Why does a transition occur when showing an element after setting a property while the element is hidden?
问题 A live example can be seen here. A red square (showing) is directly above a green square (hidden as overflow). Click on the square, and both colored squares are instantly made fully transparent. Additionally, the height of the red square is set to 0; this fires a transition, but the transition goes unseen because the red square is now transparent. Before clicking the square again, examine the toggle function. Looking at the JavaScript, I would expect the height of the red square to be reset