Collapse by code is simply not working.

hey,
in my editor the collapse works just fine. in the published site it does not collapse. i have an
if statement for something in the results i got from a database and it depends on it. but the if is going inside (in the published site i checked) so the collapse is being run. but for some reason it just dont work. no code needed it simply does not work. i heard something about the 10/70 px rule or something but didnt understand it.


the picture in the middle is collapsing when the question in the database have no image. if works fine.
here you can see the image is collapsed and as soon as i press the button for the next question

you can see it did collapse. (edited that text that was hhhh to switch to collapsed if it enters the if statement.)


here is the if statement part (i removed the text change in this picture so it will be clear. but it does go inside the if).

Hi. Your IF condition is problematic.
try:

if(!$w('#image3').src){
//
}

and remove the condition with the length ==0, which can only cause an error (because undefined has no length property) and is not needed at all (as an empty string is not truthy in JS).