You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simon Tharby edited this page Sep 28, 2020
·
4 revisions
Fixed height (in text lines), which can be specified.
Paragraphs can be specified &/or set dynamically. "<br />" = blank line.
Each paragraph will be allocated an id, enabling update or styling of text for specific paragraph(s). lines (height) and paragraphs will default to 1 and [] respectively, if not include in args.
Format:
addScrollText(name,parent,paragraphs,lines)
Example usage (see uiLayout.js for more examples):
letparent=document.getElementById("ui-container");addScrollText("scroll_A",parent,["This is a scrollable text box.","<br />","It has a fixed height and is useful when a variable quantity of text may be output to the text box.","Each paragraph is given an id value and thus can be styled &/or updated individually."],4);
Example of generated HTML:
<divclass="scroll-box scroll" id="scroll_A" style="height: 90px;"><pid="scroll_A_0">This is a scrollable text box.</p><pid="scroll_A_1"><br></p><pid="scroll_A_2">It has a fixed height and is useful when a variable quantity of text may be output to the text box.</p><pid="scroll_A_3">Each paragraph is given an id value and thus can be styled &/or updated individually.</p></div>