How do I get the size of the browser window using Prototype.js?

后端 未结 4 1825
误落风尘
误落风尘 2020-12-11 02:15

How do I get the size of the browser window using Prototype.js version 1.6.0.3?

4条回答
  •  一向
    一向 (楼主)
    2020-12-11 02:54

    According to the Prototype API documentation:

    var viewport = document.viewport.getDimensions(); // Gets the viewport as an object literal
    var width = viewport.width; // Usable window width
    var height = viewport.height; // Usable window height
    

提交回复
热议问题