gpt4 book ai didi

javascript - jquery 焦点没有设置在 firefox 上

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:36:18 24 4
gpt4 key购买 nike

我想将焦点设置到我的文本区域。以下是我的代码:

$this.textInput.val('').show().focus();

但它不起作用。实际上,当我按下鼠标按钮时,它出现了,但是当我按下鼠标按钮时,它从文本区域中删除了。所以经过大量搜索,我发现 setTimout 方法如下:

$this.textInput.mouseover(function(){                                
setTimeout($this.focus(),0);
});

但在 Firefox 中仍然无法正常工作。我有最新的 13.0 版本,但它仍然包含问题,但谷歌浏览器它工作正常。 firefox 有什么问题,有解决办法吗。

提前致谢。

最佳答案

使用 .trigger('focus')。我发现它有时比 .focus() 效果更好。

关于javascript - jquery 焦点没有设置在 firefox 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10946767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com