【问题标题】:Setting cursor blinking automatically on ui-autocomplete-input before input is selected jQuery在选择输入之前在 ui-autocomplete-input 上设置光标自动闪烁 jQuery
【发布时间】:2020-08-22 08:21:16
【问题描述】:

在选择输入之前,有人可以帮助如何在 jQuery 的 ui-autocomplete-input 上设置光标自动闪烁。我浏览了文档https://api.jqueryui.com/autocomplete/,但没有找到答案。我只找到了这个 $( ".selector" ).autocomplete( "search", "" );自动触发搜索(选择选项列表),但我只需要光标闪烁而不触发选择选项列表。

【问题讨论】:

  • 请添加示例代码
  • 光标闪烁是什么意思?
  • @sergeykuznetsov 我的意思是在 $(document).ready(function(){} 上,在用户单击输入字段之前,ui-autocomplete-input 会使光标闪烁。

标签: javascript jquery jquery-ui-autocomplete


【解决方案1】:

使用 javascript (jquery):

$(element).focus(); //you can use $("textarea") for a more generic 
//do autocomplete stuff after

(如果您在页面加载时使用自动完成)使用纯 html:

<input type="text" id="fname" name="fname" autofocus>
<!--the "autofocus" makes elements come in focus on page load-->

*w3schoolStackoverfow 上的详细信息

*这太骇人听闻了! :)
*一次只让一个元素保持焦点。

希望我能帮上忙!

【讨论】:

  • 你能分享你的代码和截图here或任何其他平台吗?谢谢
猜你喜欢
  • 2017-07-17
  • 1970-01-01
  • 2019-07-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-04
  • 2011-09-26
  • 1970-01-01
相关资源
最近更新 更多