本文整理汇总了TypeScript中ionic-angular.Animation.afterAddClass方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Animation.afterAddClass方法的具体用法?TypeScript Animation.afterAddClass怎么用?TypeScript Animation.afterAddClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Animation
的用法示例。
在下文中一共展示了Animation.afterAddClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: init
init() {
const css = this.plt.Css;
const ele = this.enteringView.pageRef().nativeElement;
const imgElement = ele.querySelector('img');
const backdropElement = ele.querySelector('ion-backdrop');
const fromPosition = this.enteringView.data.position;
const toPosition = imgElement.getBoundingClientRect();
const flipS = fromPosition.width / toPosition.width;
const flipY = fromPosition.top - toPosition.top;
const flipX = fromPosition.left - toPosition.left;
const backdrop = new Animation(this.plt, backdropElement);
const image = new Animation(this.plt, imgElement);
// Using `Animation.beforeStyles()` here does not seems to work
imgElement.style[css.transformOrigin] = '0 0';
image.fromTo('translateY', `${flipY}px`, '0px')
.fromTo('translateX', `${flipX}px`, '0px')
.fromTo('scale', flipS, 1)
.afterClearStyles([ css.transformOrigin ]);
backdrop.fromTo('opacity', 0.01, 1);
this.easing('ease-in-out')
.duration(150)
.add(backdrop)
.add(image);
const enteringPageEle: Element = this.enteringView.pageRef().nativeElement;
const enteringNavbarEle = enteringPageEle.querySelector('ion-navbar');
const enteringBackBtnEle = enteringPageEle.querySelector('.back-button');
const enteringNavBar = new Animation(this.plt, enteringNavbarEle);
enteringNavBar.afterAddClass('show-navbar');
this.add(enteringNavBar);
const enteringBackButton = new Animation(this.plt, enteringBackBtnEle);
this.add(enteringBackButton);
enteringBackButton.afterAddClass('show-back-button');
}