how can processing.js detect browser's size?

前端 未结 2 1513
伪装坚强ぢ
伪装坚强ぢ 2021-02-09 03:09

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 t

2条回答
  •  萌比男神i
    2021-02-09 03:54

     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

提交回复
热议问题