The default functionalities in Angular ScrollBar.
A live Angular example of jqxScrollBar, the jQWidgets ScrollBar component, with its complete source code below. It is one of 2 jqxScrollBar demos for Angular.
height property – Sets or gets height of the scroll bar.min property – Sets or gets the scrollbar's minimum value.max property – Sets or gets the scrollbar's maximum value.vertical property – Sets or gets the scrollbar's orientation.width property – Sets or gets width of the scroll bar.valueChanged event – This event is triggered when the value is changed.To run it in your own app, install the package with npm install jqwidgets-ng, add these files to a standalone Angular CLI app, and add jqx.base.css and a theme to the styles in angular.json. Getting started with jqxScrollBar shows the setup step by step.
import { Component, ElementRef, viewChild } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxScrollBarModule } from 'jqwidgets-ng/jqxscrollbar';
@Component({
imports: [CommonModule, jqxScrollBarModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
readonly HorizontalDiv = viewChild.required<ElementRef>('HorizontalDiv');
readonly VerticalDiv = viewChild.required<ElementRef>('VerticalDiv');
onValueChangedVertical(event: any): void {
this.VerticalDiv().nativeElement.innerHTML = 'Vertical (' + parseInt(event.currentValue) + ')';
};
onValueChangedHorizontal(event: any): void {
this.HorizontalDiv().nativeElement.innerHTML = 'Horizontal (' + parseInt(event.currentValue) + ')';
};
}
<div style="margin-bottom: 10px;" #VerticalDiv>Vertical</div>
<jqxScrollBar (onValueChanged)="onValueChangedVertical($event)"
[width]="18" [height]="280"
[min]="0" [max]="1000" [vertical]="true">
</jqxScrollBar>
<div style="margin: 10px 0;" #HorizontalDiv>Horizontal</div>
<jqxScrollBar (onValueChanged)="onValueChangedHorizontal($event)"
[width]="280" [height]="18"
[min]="0" [max]="1000">
</jqxScrollBar>