Use settimeout to write the expansion and contraction of the secondary menu. Pass a function with parameters in settimeout. I don’t know how to pass it. In the video, it is written like this: setTimeout("addHeight('" ul "')",10 ) but it’s not normal. What’s the reason?
setTimeout The first parameter of this function can accept a function or a piece of code. If it is code, put it into
eval
for execution.The way you write here is the way you write a piece of code. Please check whether the quotation marks are written correctly in one-to-one correspondence. Or change to the following two writing methods and it should work normally