javascript - iPad 光标在文本区域跳跃(位移)

标签 javascript css ipad textarea

我正在检查我在装有 iOs 5.1 的 Ipad 中的应用程序 当我点击 textarea 时,光标会跳到书写线上方两行。 虽然焦点位于正确的位置,但光标的视觉外观出现在焦点线上方两行。 对此有任何建议。

This is CSS file code

This is HTML part taken from firebug not from file(you can see tag names) video to show problem(video is not made by me , but problem is similar)

最佳答案

iPad 可能在 touch 事件上有一些偏移,你可以用这样的函数取消它:

$('#yourTextarea').on('touchstart', function (event) {
    event.preventDefault(); //should prevent the hop
    // rest of your code goes here
});

关于javascript - iPad 光标在文本区域跳跃(位移),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10499893/

相关文章:

javascript - 如何获取 less 文件中定义的颜色的 RGB 值?

php - 如何从 jQuery 调用中创建/检索数组

javascript - 防止 iOS safari 移动网页窗口以便发生拖动事件

html - 如何在 Foundation 6.4 上创建页脚列?

html - 展开 float 元素后的空白

iphone - Xcode-组织者不显示应用程序

javascript - 动态形式实时计算总计

html - 删除页脚图像和页脚背景之间的填充

ios - UITableView 在重新加载后选择添加/编辑的行(带部分)

iOS:开始在后台处理推送通知?