Skip to main content

getScrollState()

Description

Returns the position of the diagram inner scroll

Usage

getScrollState(): object;

Returns

The method returns an object which stores positions of scrolls. It includes two properties:

  • x - horizontal scroll position
  • y - vertical scroll position

Example

const diagram = new dhx.Diagram("diagram_container");
diagram.data.parse(data);

const state = diagram.getScrollState();
// diagram.scrollTo( state.x, state.y );

Related articles: Scrolling Diagram

Related sample: Diagram. Scroll content