值得一提的是,来自 Microsoft 的示例确实包含这种评论风格。来自视差样本:
constructor(scrollableContent: HTMLElement, perspective: number) {
/// <param name="scrollableContent">The container that will be parallaxed.</param>
/// <param name="perspective">The ratio of how much back content should be
/// scrolled relative to forward content. For example, if this value is
/// 0.5, and there are 2 surfaces, the front-most surface would be scrolled
/// normally, and the surface behind it would be scrolled half as much.</param>
this.perspective = perspective;
this.surface = [];
this.content = scrollableContent;
$(scrollableContent).scroll((event: JQueryEventObject) => {
this.onContainerScroll(event);
});
}