大佬教程收集整理的这篇文章主要介绍了焦点输入上的Mobile Safari jQuery select()不起作用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
$(document).ready(function() { //SELEct text on focus for input $("input:text").focus(focustext); }); function focustext() { var input = $(this); setTimeout(function() { input.SELEct(); },100); }
但这不适用于Safari Mobile.
我已经阅读了几个关于此的主题,例如:
Workaround to Webkit[Chrome/Safari] javascript select on focus bug (when using tab between fields)
Selecting text on focus using jQuery not working in iPhone iPad Browsers
我已经在一个简单的假人中测试了建议的溶剂,但是我无法在iPad上使用它们.
http://kraner.se/customers/test.html
$(document).ready(function() { //SELEct text on focus for input $("input:text").focus(focustext); }); function focustext() { var input = this; setTimeout(function () { input.SELEctionStart = 0; input.SELEctionEnd = input.val().length; },100); }
现在它的作用是有意的.输入类型=数字似乎不起作用.
我已经在iOS6和iOS7上对此进行了测试,它也可以在Windows 7上的最新Chrome和IE中运行.但是在兼容模式下的IE不起作用.
以上是大佬教程为你收集整理的焦点输入上的Mobile Safari jQuery select()不起作用全部内容,希望文章能够帮你解决焦点输入上的Mobile Safari jQuery select()不起作用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。