Skip to content

Latest commit

 

History

History
63 lines (56 loc) · 1.82 KB

README.md

File metadata and controls

63 lines (56 loc) · 1.82 KB

VirtualContent

VirtualContent - is a browser tool designed for handling large text/html content.

Installation

npm i --save virtualcontent

Usage

import "VC" from "virtualcontent";

VC.create(options).setText(str).renderTo($container);

Options

ParameterAcceptsDefault valueDescription
appendBoolfalseSwitch to Append mode (Replace mode is the default)
chunkPreProcessorFunctionnullSet function which receives chunk (String) as a first argument, and returns String.
delayInteger100Delay scroll processing.
lengthNumber10240Set maximum length for a chunk string
scrollableParentNode/jQueryEl/selectorundefinedSet scrollable parent node.
thresholdNumber2It defines how much chunks are shown at once in Replace mode (default)

API

MethodArgumentsReturnsDescription
create (static)optionsNew instanceCreate new VC instance
destroynoneselfDestroy VC instance
renderToNode/jQueryElselfRender to node or $el
setHtmlStringselfSet HTML content
setTextStringselfSet text content