new VarSlider(parent, props)
Slider element. Additional callbacks can be added with the onChange method. This class focuses on the specific properties of the SliderVar component. Since it inherits from Accessor_A, all basic properties (e.g., height, width) are available but documented in the Accessor_A part.
| Name | Type | Description |
|---|---|---|
parent | HTMLElement | HTML element that is going to be the parent of the component |
props | TComponents. |
- Source
const slider = new TComponents.VarSlider(document.body,{
position: 'absolute',
zIndex: 1000,
});
// Render the component.
slider.render();Extends
Members
text :number
Set current text value
- number
- Source
const slider = new TComponents.VarSlider(document.body,{
position: 'absolute',
zIndex: 1000,
});
// Render the component.
slider.render();
// Set the text.
slider.text = 20;Methods
(protected) afterRenderOnce() → {void}
there are something need to do after render once
- Overrides
- Source
- Type:
- void
checkValueInRange(value) → {number}
Check if the value is in the range of min and max
| Name | Type | Description |
|---|---|---|
value | number | The value to be checked |
- Source
- The valid value within the range
- Type:
- number
(protected) defaultProps() → {TComponents.VarSliderProps}
Returns the default values of class properties (excluding parent properties).
- Overrides
- Source
markup() → {string}
Generates the markup for the slider component.
- Overrides
- Source
HTML markup string
- Type:
- string
onRender() → {void}
Renders the slider component.
- Overrides
- Source
Throws an error if rendering fails.
- Type
- Error
- Type:
- void
(static) loadCssClassFromString(css) → {void}
Add css properties to the component
| Name | Type | Description |
|---|---|---|
css | string | The css string to be loaded into style tag |
- Source
- Type:
- void
TComponents.VarSlider.loadCssClassFromString(`
.tc-var-slider {
height: inherit;
}`
);