Hai*_*ood 3 jquery events blur settimeout
是否可以在这些情况下触发的输入上定义事件.
a) is called on blur of input IF the remaining conditions are true b) if the autocomplete list is visible halt the event until it is closed c) if the autocomplete list closes without an item being selected then the event is fired d) if the autocomplete list closes with an item being selected the event is not fired e) if the reason the blur was caused was because an item in the autocomplete was clicked the event is not fired
正如你所看到的那样,事件有很多.我无法在模糊事件中使用正常的setTimeout,因为用户可能坐在自动完成列表上而没有实际选择任何内容.
也许我可以在自动完成打开时设置一个变量,所以我们知道它仍然是开放的.
如果计时器到期且自动完成仍然打开,我们可以重置计时器.
然后在关闭时我们可以取消设置变量.
或者在选择项目时我们可以取消定时器?
你怎么看?