本文整理匯總了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');
}