TextArea.scrollTo

Syntax

scrollTo(positionV: Number, positionH: Nubmer, isPercent:Boolean, fireEvent: Boolean);

Parameters

positionV. Position of vertical scrollbar.

positionH. Position of horizontal scrollbar.

isPercent. Flag indicating if position is set as a percentage.

fireEvent. Event firing flag.

Description

The scrollTo method sets scroll position.

Example

To execute the example, the page must contain the TextArea component named textArea1 (see Example of Creating the TextArea Component ). Scroll vertically to the position equal to 50% of the scrollbar:

// Generate text contents
var text;
for (var i = 0; i < 20; i++) {
    text += "Line " + i + "<br>";
};
// Change component text contents
textArea1.setContent(text);
// Scroll vertically to the position equal to 50% of the scroll bar
textArea1.scrollTo(50, 0, true, true);

Vertical scrolling was executed as the result of example execution:

See also:

TextArea