修复了大小的 Windows

如果你要为不同的移动设备设计具有固定大小屏幕的布局,你可能希望在桌面上运行应用程序时镜像该设计。以下方法修复了 PhoneGap 窗口 OUTSIDE 的大小,在桌面上提供了固定大小的窗口。有时通过限制选项来管理用户的期望和 UI 设计是最容易的!

// create a window of a specific size
var w=window.open('','', 'width=100,height=100');
w.resizeTo(500,500);

// prevent window resize
var size = [window.width,window.height];  //public variable
$(window).resize(function(){
    window.resizeTo(size[0],size[1]);
});