[对不起,我的英语不好]
我必须创建带有滚动按钮的可滚动视图,如下图所示:

overflow,则显示右/左按钮。scrollLeft === 0禁用左按钮。另外,当该scrollLeft值为 max 时,禁用右键。<section class="list-with-scroll">
<div class="list" #list>
<div *ngFor="let i of items" class="item">{{i}}</div>
</div>
<button class="scroller" *ngIf="isOverflown(list)" [class.disable]="!canScrollStart(list)" (click)="scroll(list,-1)" id="scroll-left">⇦</button>
<button class="scroller" *ngIf="isOverflown(list)" [class.disable]="!canScrollEnd(list)" (click)="scroll(list,1)">⇨</button>
</section>
Run Code Online (Sandbox Code Playgroud)
成分:
export class AppComponent {
items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"];
isOverflown(element: HTMLElement) {
return element.scrollWidth > element.clientWidth;
}
scroll(element: HTMLElement, direction: number) {
element.scrollLeft += 100 * direction;
}
canScrollStart(element: …Run Code Online (Sandbox Code Playgroud) 我绝对是 SVG 的初学者,我必须创建类似下图的东西:
规格:
这是我的尝试:
<svg viewBox="0 0 100 100">
<circle cx="50%" cy="50%" r="50%" style="fill:none;stroke:#00be00;stroke-width:5" />
<path id="top-sector" style="fill:none;stroke:#be3000" d="M 15,37 A 50,50 0 0 1 80,50" />
<text text-anchor="middle">
<textPath xlink:href="#top-sector" startOffset="50%" style="font-size: 6px;">Hello World</textPath>
</text>
</svg>
Run Code Online (Sandbox Code Playgroud)
JsFiddle: https: //jsfiddle.net/9hprLxat/2/
我不知道: