本文整理汇总了TypeScript中@angular/platform-browser/src/animate/animation_builder.AnimationBuilder类的典型用法代码示例。如果您正苦于以下问题:TypeScript AnimationBuilder类的具体用法?TypeScript AnimationBuilder怎么用?TypeScript AnimationBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AnimationBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
private animationBuilder: AnimationBuilder,
private elementRef: ElementRef) {
this.cssAnimationBuilder = animationBuilder.css()
.setDuration(300)
.setToStyles({ backgroundColor: '#fff5a0' });
}
开发者ID:Jabirfayyaz,项目名称:learning-angular2,代码行数:8,代码来源:highlight.directive.ts
示例2: constructor
constructor(
private settingsService: SettingsService,
private routeParams: RouteParams,
private taskService: TaskService,
private animationBuilder: AnimationBuilder,
private elementRef: ElementRef) {
this.buttonLabelsMap = settingsService.labelsMap.timer;
this.fadeInAnimationBuilder = animationBuilder.css();
this.fadeInAnimationBuilder.setDuration(1000)
.setDelay(300)
.setFromStyles({ opacity: 0 })
.setToStyles({ opacity: 1 });
}
开发者ID:Jabirfayyaz,项目名称:learning-angular2,代码行数:14,代码来源:timer-widget.component.ts
示例3: toggle
toggle(isVisible: boolean = false, showNav: boolean, navHeight?: number) {
let heightChild, item, thisElement = this._e.nativeElement;
let animation = this._ab.css();
if (showNav) {
animation.setDuration(0);
} else {
animation.setDuration(200);
}
if (navHeight === undefined) {
thisElement = this._e.nativeElement.childNodes[4];
if (this._e.nativeElement.childNodes[4].tagName === 'UL') {
heightChild = thisElement.childNodes[2].clientHeight;
} else {
return;
}
item = thisElement.children.length;
if (isVisible) {
animation
.setFromStyles({height: '0'})
.setToStyles({height: heightChild * item + 'px'});
} else {
animation
.setFromStyles({height: heightChild * item + 'px'})
.setToStyles({height: '0'});
}
} else {
if (!isVisible) {
animation
.setFromStyles({height: '0'})
.setToStyles({height: navHeight + 'px'});
} else {
animation
.setFromStyles({height: navHeight + 'px'})
.setToStyles({height: '0'});
}
}
animation.start(thisElement);
if (!isVisible) {
setTimeout(() => {
this._e.nativeElement.removeAttribute('style');
}, 430);
}
}
开发者ID:richardsonlima,项目名称:SMSC,代码行数:51,代码来源:animate.ts
示例4: slideVertical
slideVertical(obj) {
this._ab.css()
.setDuration(300)
.setToStyles({transform: 'translateY('+obj.distance+'px)'})
.start(this.element.nativeElement);
}
开发者ID:darklove0504,项目名称:angular-draggable,代码行数:6,代码来源:drag-element.directive.ts
注:本文中的@angular/platform-browser/src/animate/animation_builder.AnimationBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论