The ScrollView component for Angular represents a widget which can be used for viewing content which is wider than the visible area outlined by the device's screen. Specific item can be chosen using drag movements or clicking/tapping on the buttons at the bottom of the ScrollView.
npm install -g @angular/cli ng new jqwidgets-project cd jqwidgets-project
ng add jqwidgets-ng
jQWidgets UI for Angular is distributed as jqwidgets-ng NPM package
npm install jqwidgets-ng
@import 'jqwidgets-ng/jqwidgets/styles/jqx.base.css';
"styles": [ "node_modules/jqwidgets-ng/jqwidgets/styles/jqx.base.css" ]
<jqxScrollView [theme]="'fluent'" #myScrollView
[width]="600" [height]="450" [buttonsOffset]="[0, 0]">
<div><div class="photo" style="background-image: url(https://www.jqwidgets.com/angular/images/imageNature1.jpg)"></div></div>
<div><div class="photo" style="background-image: url(https://www.jqwidgets.com/angular/images/imageNature2.jpg)"></div></div>
<div><div class="photo" style="background-image: url(https://www.jqwidgets.com/angular/images/imageNature3.jpg)"></div></div>
<div><div class="photo" style="background-image: url(https://www.jqwidgets.com/angular/images/imageNature4.jpg)"></div></div>
<div><div class="photo" style="background-image: url(https://www.jqwidgets.com/angular/images/imageNature5.jpg)"></div></div>
</jqxScrollView>
<div style="margin-top: 2em"></div>
<jqxButton [theme]="'fluent'" (onClick)="onStartClicked()"
[width]="120" [height]="25">
Start SlideShow
</jqxButton>
<jqxButton [theme]="'fluent'" (onClick)="onStopClicked()"
[width]="120" [height]="25">
Stop SlideShow
</jqxButton>
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
import { jqxButtonComponent, jqxButtonModule } from 'jqwidgets-ng/jqxbuttons';
import { jqxScrollViewModule, jqxScrollViewComponent } from 'jqwidgets-ng/jqxscrollview';
@Component({
selector: 'app-root',
imports: [jqxScrollViewModule, jqxButtonModule],
standalone: true,
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
@ViewChild('myScrollView') myScrollView: jqxScrollViewComponent;
onStartClicked(): void {
this.myScrollView.slideShow(true);
};
onStopClicked(): void {
this.myScrollView.slideShow(false);
};
}