Get Application Page Dimensions with BX24.getScrollSize

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
BX24.getScrollSize(): object;
        

The BX24.getScrollSize method returns the width and height of the application page inside the frame. BX24.fitWindow uses this height when it fits the frame to the content.

The dimensions are never smaller than the visible part of the frame: if the content is shorter than the frame, the method returns the frame height. To find out the height of the content itself, measure the element that contains it, for example, using its offsetHeight property.

The method measures the application page and does not call Bitrix24, so it also works before BX24.init. The method requires no scope of its own.

Method Parameters

No parameters.

Code Example

How to Use Examples in Documentation

BX24.init(function () {
            const size = BX24.getScrollSize();
            console.log(size.scrollWidth, size.scrollHeight); // 1108 604
        });
        

Response Handling

The method synchronously returns an object with the dimensions of the application page:

{
            "scrollWidth": 1108,
            "scrollHeight": 604
        }
        

Returned Data

Name
type

Description

result
object

An object with the dimensions of the application page (detailed description)

Object result

Name
type

Description

scrollWidth
integer

The width of the application page in pixels, but not less than the frame width

scrollHeight
integer

The height of the application page in pixels, but not less than the frame height

Error Handling

The method does not return error codes.

Continue Learning