Fabric.js getScrollLeftTop() Method
The getScrollLeftTop() method in Fabric.js is used to find the scroll offsets of an element. The object returned by this method contains the “top” and “left” property that denotes the “top” and “left” offsets respectively. The HTML element in the page has to be selected first to pass this method.
Parameters: This method accepts a single parameter as mentioned above and described below:
- element: This parameter is used to specify the HTML element for which the scroll offsets have to be found.
Return Value: This method returns an object that contains the “top” and “left” scroll offsets as properties.
The below example demonstrates the getScrollLeftTop() method Fabric.js: