new ScrollBar(configopt)
Base scroll bar implementation.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
<optional> |
{} | init parameters (all inherited from the parent) Properties
|
- Source:
Example
var ScrollBar = require('stb/ui/scroll.bar'),
scrollBar = new ScrollBar({
viewSize: 5,
realSize: 25,
events: {
done: function () {
debug.log('ScrollBar: done');
},
change: function ( data ) {
debug.log('ScrollBar: change to ' + data.curr + ' from ' + data.prev);
}
}
});
Extends
- Component
Members
realSize :number
Scroll area actual height or width (if scroll is horizontal).
Type:
- number
- Source:
thumbRect :ClientRect
Geometry of the scroll thumb element.
Type:
- ClientRect
- Source:
trackRect :ClientRect
Geometry of the scroll track element.
Type:
- ClientRect
- Source:
type :number
Component orientation.
Type:
- number
- Source:
value :number
Scroll thumb position.
Type:
- number
- Source:
viewSize :number
Visible area size.
Type:
- number
- Source:
Methods
init(config)
Init or re-init realSize/viewSize/value parameters.
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | init parameters (subset of constructor config params) |
- Source:
scrollTo(value) → {boolean}
Set position of the given value. Does nothing in case when scroll is in the end and passed value is more than scroll bar length.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | new value to set |
- Source:
Fires:
Returns:
operation result
- Type
- boolean