CSS transition fade in

前端 未结 4 1923
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 02:36

So I have used CSS transitions before but I have a unique case with this one. I am writing a custom plugin for creating modals. Essentially I create a div on the fly

4条回答
  •  悲哀的现实
    2020-12-03 03:25

    CSS Keyframes support is pretty good these days:

    .fade-in {
    	opacity: 1;
    	animation-name: fadeInOpacity;
    	animation-iteration-count: 1;
    	animation-timing-function: ease-in;
    	animation-duration: 2s;
    }
    
    @keyframes fadeInOpacity {
    	0% {
    		opacity: 0;
    	}
    	100% {
    		opacity: 1;
    	}
    }

    Fade Me Down Scotty

提交回复
热议问题