1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-17 23:34:50 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/ScrollableWidget.tid
Jermolene df84e93283 Add position: relative to scrollable widget
So that popups within the scrollable behave correctly.

Fixes #1679
2015-04-27 13:38:20 +01:00

49 lines
1.6 KiB
Plaintext

created: 20140324223413403
modified: 20150427123524945
tags: Widgets
title: ScrollableWidget
type: text/vnd.tiddlywiki
caption: scrollable
! Introduction
The scrollable widget wraps its content in a scrollable frame. The user can scroll the contents with the mouse or with touch gestures. Code can use the [[WidgetMessage: tm-scroll]] to programmatically scroll specific DOM nodes into view.
! Content and Attributes
The content of the `<$scrollable>` widget is displayed within a pair of wrapper DIVs. If the inner DIV is larger then it scrolls within the outer one. CSS is used to specify the size of the outer wrapper.
|!Attribute |!Description |
|class |The CSS class(es) to be applied to the outer DIV |
|fallthrough |See below |
If a scrollable widget can't handle the `tm-scroll` message because the inner DIV fits within the outer DIV, then by default the message falls through to the parent widget. Setting the ''fallthrough'' attribute to `no` prevents this behaviour.
! Examples
This example requires the following CSS definitions from [[$:/_tw5.com-styles]]:
```
.tc-scrollable-demo {
border: 1px solid <<colour message-border>>;
background-color: <<colour message-background>>;
padding: 1em;
height: 400px;
position: relative;
}
```
This wiki text shows how to display a list within the scrollable widget:
<<wikitext-example-without-html "<$scrollable class='tc-scrollable-demo'>
<$list filter='[!is[system]]'>
<$view field='title'/>: <$list filter='[all[current]links[]sort[title]]' storyview='pop'>
<$link><$view field='title'/></$link>
</$list>
</$list>
</$scrollable>
">>