-
Is it possible to attach the scrollbar to an object with varying height? If I gradually added text to a text element with a scrollbar attached, how would I make the scrollbar automatically adjust to the new height of the text element? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It turns out you can't just add text to the text element the scrollbar is attached to. After attaching the scrollbar it creates a new element within the text element which holds all the content. New text must be added to the scrollbar's content which can be accessed with Here is an example: |
Beta Was this translation helpful? Give feedback.
It turns out you can't just add text to the text element the scrollbar is attached to. After attaching the scrollbar it creates a new element within the text element which holds all the content. New text must be added to the scrollbar's content which can be accessed with
scrollbar.getElements().content
.Here is an example:
https://codepen.io/leonshams/pen/gORLvRd