When my browser scroll bar ScrollTop is greater than 0, when I click the scroll bar of the first picture, the drop-down list disappears. Why is this?
The scroll bar must not have added document.documentElement.scrollTop, try adding it.
The scroll bar is definitely not added with document.documentElement.scrollTop, try adding it.
What framework are you using? Which (first picture) pop-up layer is simulated with div?
Because no online address or code package is provided, this error can only be guessed. It is estimated that the positioning of this simulated drop-down table is done using absolute positioning, and then there is no enhancement to scrollTop, so it may be possible after clicking Even if the position changes, the top value of absolute positioning does not change. Therefore, it is recommended to add: document.documentElement.scrollTop and try this value. This value is scrollTop in the picture. If it doesn't work, that's not the reason.
I solved it myself. Although it didn't help me, I still thank you very much.