How to set animation on first element on loading?

后端 未结 2 1511
情书的邮戳
情书的邮戳 2020-12-19 22:56

I am using Angular2 with SystemJs. I am wondering how can I set some animation (like fade-out effect) on the Loading label in this example. We can see the label

2条回答
  •  佛祖请我去吃肉
    2020-12-19 23:09

    The best way is add a class hidden to the label, and after load app remove the class.

    To achieve the fade animation with css add this properties to the label:

    transition: all 0.5s
    opacity: 1
    

    And to the class hidden

    .hidden {
        opacity: 0 !important
    }
    

    When you remove the hidden class it will animate opacity to default value that is 1 (100%).

    If you have JQuery in your app can use $('label').fadeOut(). But nowadays is better use pure CSS

提交回复
热议问题