本文介绍了如何processing.js检测浏览器的尺寸是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如前面提到的,怎么能processing.js到浏览器的大小应对呢? (响应式设计)
我试过screen.width和screen.height但它没有很好地工作。看来只有检测计算机的屏幕尺寸的大小。

更重要的是,我要拖到什么时候跟上窗口的大小步伐,改变浏览器的大小


解决方案

 尺寸(window.innerWidth,window.innerHeight);

根据

<一href=\"https://groups.google.com/forum/?fromgroups=#!topic/processingjs/2-U_P7_BHlY\">https://groups.google.com/forum/?fromgroups=#!topic/processingjs/2-U_P7_BHlY

 无效设置(){
大小($(窗口).WIDTH(),
    $(窗口).height());
...
}

根据

Get视口宽度与jQuery和使用JS处理

As mentioned, how can processing.js respond to a browser's size? (responsive design)i've tried screen.width and screen.height but it didn't work well. It seems only detect the size of the computer's screen size.

What's more, i want to keep pace with the window's size when dragged and changed the size of the browser

解决方案
 size(window.innerWidth, window.innerHeight);

according to https://groups.google.com/forum/?fromgroups=#!topic/processingjs/2-U_P7_BHlY

or

void setup() {
size( $(window).width(),
    $(window).height() );
...
}

according to Get Viewport Width With JQuery and Use In Processing JS

这篇关于如何processing.js检测浏览器的尺寸是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 20:21