开发者

Stick an element to the iPhone keyboard (JS, CSS?)

开发者 https://www.devze.com 2023-04-01 13:35 出处:网络
I\'m developing a webapp开发者_JS百科 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 appe

I'm developing a webapp开发者_JS百科 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:

Stick an element to the iPhone keyboard (JS, CSS?)

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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号