$(window).resize有什么作用? JQuery Mobile [英] What does $(window).resize do? JQuery Mobile

查看:216
本文介绍了$(window).resize有什么作用? JQuery Mobile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我看了一下jquery mobile,对于我的ipad webapp,我看到了这个:

So I had a look at jquery mobile, for my ipad webapp, and I saw this:

http://api.jquery.com/resize/

当然,我是哪个我正在考虑这个:
如何调整/重新缩放网页ipad

Which, of course, I'm looking at because of this: how to resize / rezoom webpage in ipad

但事实是,这个window.resize对我来说并不是一件坏事。至少,我期望它重新应用最大规模和最小规模值

But the thing is, this window.resize doesn't do a darn thing for me. At least, I was expecting it to re-apply the maximum-scale and minimum-scale values

它没有。我在这里遗漏了什么,或者是window.resize上下铺?

It does not. Am I missing something here, or is window.resize bunk?

UPDATE
我想我的意思是:在一个方向改变后,window.resize是否会触发ipad,如果是这样,它是否会导致比例 - 最小比例和最大比例 - 被重置?

UPDATE I suppose i mean : does the window.resize fire after an orientation change on an ipad, and if so, does it cause the scales -minimum-scale and maximum-scale - to be reset?

推荐答案

$(window).resize 根据api doc有两种语法:第一种是绑定要在调整大小时执行的函数,第二种是触发回调到侦听调整大小事件的函数。

$(window).resize as per the api doc has two syntaxes: the first one is to bind a function to be executed upon resize, and the second one to trigger the callback to functions that listens to the resize event.

除了为您提供方法之外,它本身不会做任何事情为事件设置一个监听器并在需要时手动触发它 - 所以它不会重置任何其他属性

It does not do anything per se except provide you with a way to set up a listener for the event and manually trigger it if needed - so it won't reset any other properties

据我所知,ipad方向改变DO触发使用safari时调整事件大小。但是,如果您的应用使用原生uiwebview,则方向更改可能不会触发它。

To the best of my knowledge, ipad orientation changes DO trigger resize events when using safari. However, if your app is using a native uiwebview, it is possible that orientation changes don't trigger it.

这篇关于$(window).resize有什么作用? JQuery Mobile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆