當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript AnimationBuilder.css方法代碼示例

本文整理匯總了TypeScript中@angular/platform-browser/src/animate/animation_builder.AnimationBuilder.css方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript AnimationBuilder.css方法的具體用法?TypeScript AnimationBuilder.css怎麽用?TypeScript AnimationBuilder.css使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/platform-browser/src/animate/animation_builder.AnimationBuilder的用法示例。


在下文中一共展示了AnimationBuilder.css方法的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: 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

示例3: 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

示例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.css方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。