Why does the js assign a value to the div height to be refreshed before it is displayed?

clipboard.png
js first gets the height of a picture, and then assigns a value to a Div why it is refreshed before it appears, and how to solve the problem and ask for help from passers-by!

Mar.10,2021

can you see if your imgHeight is 0 when it doesn't work? It feels like when performing js, the picture is not loaded and has no height.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e6513e-45afa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e6513e-45afa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?