css 幻灯片动画

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 幻灯片动画相关的知识,希望对你有一定的参考价值。

$(window).scroll(function() {
            $(".slideanim").each(function() {
                var pos = $(this).offset().top;

                var winTop = $(window).scrollTop();
                if (pos < winTop + 600) {
                    $(this).addClass("slide");
                }
            });
        });
/* Slide animation */
.slideanim {visibility:hidden;}
.slide {
    /* The name of the animation */
    animation-name: slide;
    -webkit-animation-name: slide;
    /* The duration of the animation */
    animation-duration: 1s;
    -webkit-animation-duration: 1s;
    /* Make the element visible */
    visibility: visible;
}

/* Go from 0% to 100% opacity (see-through) and specify the percentage from when to slide in the element along the Y-axis */
@keyframes slide {
    0% {
        opacity: 0;
        transform: translateY(70%);
    }
    100% {
        opacity: 1;
        transform: translateY(0%);
    }
}
@-webkit-keyframes slide {
    0% {
        opacity: 0;
        -webkit-transform: translateY(70%);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0%);
    }
}

以上是关于css 幻灯片动画的主要内容,如果未能解决你的问题,请参考以下文章

试图制作我在 CSS 中完成但失败的代码的动画幻灯片

将鼠标悬停在css上时如何暂停幻灯片自动播放?

CSS 3 |水平滑动动画

路由组件的Angular 2“动画幻灯片”

将 css 添加到 jquery 'flux' 动画

CSS 动画过渡不适用于 Firefox