Roh*_*hit 10 javascript html5 angularjs
当我在桌面或Android设备上运行应用程序时,输入焦点工作正常.但它不适用于ios 10 Safari.我正在使用angularjs.
$timeout(function () {
var input = $element.find('.my-input-box')[0];
input.focus();
}, 500);
Run Code Online (Sandbox Code Playgroud)
由于您使用的是 AngularJS,因此您绝对应该尝试在 Angular 中找到解决方案。
您是否尝试使用ngFocus。
我想它可能看起来像这样:
html:
<input ng-focus="YourVariable">
Run Code Online (Sandbox Code Playgroud)
并将 YourVariable 设置为 True。
| 归档时间: |
|
| 查看次数: |
1304 次 |
| 最近记录: |