If you use $(this).hide(); in a click event, the element will not be hidden.
Then add a parameter speed to hide(), and hide(1) can hide it. Why is this?
There is a saying in w3school "If the element is already fully visible, the effect will not change unless a callback function is specified."
How to understand?
Add a parameter
1
, which just adds a transition animation with a time span of1ms
. Without adding parameters, it will be hidden directly.For the problem described by the subject, it is best to provide a demo, otherwise it will be difficult to follow up