简体   繁体   English

使用JavaScript在iPhone Safari浏览器上自动缩小

[英]Zoom out automatically on iPhone safari browser using javascript

I have designed my webpage to fit an Iphone screen perfectly. 我设计的网页非常适合Iphone屏幕。 It has a small text box in the top corner. 它的右上角有一个小文本框。 When the user clicks on the text box to type in the text, the Iphone browser automatically zooms into the top corner of the screen, which is totally cool. 当用户点击文本框的文本输入,iPhone的浏览器会自动放大到屏幕上,这是很酷的右上角。 But after the user hits search the browser is still zoomed into the top corner. 但是在用户点击搜索后,浏览器仍会放大到顶角。 The user has to manually zoom out to see the full screen. 用户必须手动缩小以查看全屏。

Hence I would like to know a way to fix this issue by calling a javascript that will zoom out automatically and shows the full web page. 因此,我想知道一种方法,可以通过调用将自动缩小并显示完整网页的JavaScript来解决此问题。

Thanks 谢谢

I'm having the same problem/requirement, so I was hoping to find an answer here (which I haven't). 我有相同的问题/要求,所以我希望在这里找到答案(我没有)。

Here is what I've got so far: 以下是我到目前为止有:

Add an 'onblur' event handler to the text box mark-up (in the HTML, where you declare the text box). 将“ onblur”事件处理程序添加到文本框标记(在HTML中声明文本框的位置)。

The callback is triggered after the 'Done' button is pressed. 按下“完成”按钮后将触发回调。

At this point, I'm not sure how to zoom out back to the previous zoom-level. 此时,我不确定如何缩小到先前的缩放级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM