将一个元素粘贴到 iPhone 键盘上(JS、CSS?)

发布于 2024-12-02 07:20:32 字数 275 浏览 0 评论 0原文

我正在使用 jQuery Mobile 开发一个网络应用程序。我想做的一件事是显示某些输入字段的一些自动完成建议。我希望带有这些建议的块看起来就像扩展了屏幕键盘一样,恰好位于其顶部边缘,并在我滚动页面时保持在那里。

一个快速而肮脏的插图:

auto-complete suggest

我看到一些本机应用程序正在做类似的事情。有没有办法只用 jQuery/JS 和 CSS 来实现这一点?

I'm developing a webapp using jQuery Mobile. One thing I want to do is to display some auto-complete suggestions for certain input fields. I want the block with those suggestions to appear as if it extends the onscreen keyboard, resting exactly on its top edge and staying there when I scroll the page.

A quick and dirty illustraion:

auto-complete suggestions

I see similar sort of things being done in some native apps. Is there a way to achieve this with just jQuery/JS and CSS?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

提笔落墨 2024-12-09 07:20:32

我认为这是不可能的。
键盘是属于浏览器的系统实体。
您可以稍微操纵它的显示方式...针对电子邮件、URL、数字或电话号码进行定制。

请阅读此处:http://developer.apple.com /library/safari/#codinghowtos/Mobile/UserExperience/index.html

I dont think this will be possible.
The keyboard is a system entity that belongs to the browser.
You can manipulate the way it is displayed slightly... tailored for email, URL, numeric or phone number.

Have a read here: http://developer.apple.com/library/safari/#codinghowtos/Mobile/UserExperience/index.html

差↓一点笑了 2024-12-09 07:20:32

我相信这只有作为本机应用程序才有可能,除非您找到一种方法(可能使用 JavaScript)让您的自动完成建议从查看窗口顶部“浮动”一定高度。

例如,如果您以像素为单位测量屏幕,请将自动完成“栏”从 iPhone 状态栏顶部浮动 x 像素数。棘手,但有可能

I believe this is only possible as a native app UNLESS you figure out a way (probably with JavaScript) to have your auto-complete suggestions "float" a certain height from the top of the viewing window.

For example, if you measure the screen in pixels, float your auto-complete "bar" x-number of pixels from the top of the iPhone's status bar. Tricky, but possible

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文