有什么方法来确定是否一个HTML选择当前处于打开状态?有什么、方法来、状态、HTML

2023-09-11 01:19:39 作者:荒岛

我有一个网页,做一个连续的ajax刷新,我不希望这样做的刷新,如果用户当前正在进行的下拉列表中选择。有没有什么办法来检查用户是否下拉打开,然后停止更新?

I have a page that is doing a continuous ajax refresh, and I don't want to do this refresh if the user is currently making a selection in a dropdown. Is there any way to check if the user has the dropdown opened, and then stop the update?

谢谢!

推荐答案

我能想到的唯一的办法,就是用一个标志(变量),这将改变值,当用户点击SELECT(和知道,当第一次加载页面的选择是关闭)这应该可以很容易地知道,如果选择是开放与否。

The only way I can think of, is to use a flag (a variable) that will change value when the user clicks the SELECT (and knowing that when the page is first loaded, the SELECT is closed) this should make it easy to know if the SELECT is open or not.