Skip to content

9. Using ScrollLayout

fahimc edited this page Feb 17, 2013 · 4 revisions

This enables custom scrollbars for all browsers and devices.

Basic CSS

.scrollTrack
{
  width:20px;
  background-color: #000;
}
.scrollThumb
{
  width:20px;
  background-color: #e4e4e4;
}

Adding ScrollLayout to a UIElement

If you element needs a scrollbar the scrollbar will appear. You need to call arrange when updating the element to update the scrollbar.

test = new UIElement);
test.layout(new ScrollLayout());
test.layout().scrollHeight = 300;
test.width(700);
test.height(500);
test.build();
test.setStyle();
document.body.appendChild(test.display);
test.arrange();

Updating the ScrollLayout

call arrange() on the element

Clone this wiki locally