js控制css动画

            @keyframes move {

                            from {

                                left: 38px;

                            }

                            to {

                                left: 160px

                            }

                        }

                        @keyframes big {

                            0% {

                                width: 20%;

                                left: 20px;

                            }

                            10% {

                                width: 40%;

                                left: 20px;

                            }

                            20% {

                                width: 60%;

                                left:  20px;

                            }

                            30% {

                                width: 70%;

                                left: 20px;

                            }

                            40% {

                                width: 60%;

                                left: 22px;

                            }

                            50% {

                                width: 50%;

                                left: 28px;

                            }

                            100% {

                                width: 28px;

                                left: 38px;

                            }

                        }

 newAnimationStyle.style.animation = 'big 1s forwards';

 newAnimationStyle.style.animation = 'move 1s forwards';

你可能感兴趣的:(学习笔记,css)