jquery - 关键帧不起作用

标签 jquery css keyframe

大家好,我正在尝试为我的顶栏和一些框创建关键帧动画,但它不起作用,请帮助我解决我的 fiddle

 @-webkit-keyframes flow{

    0% {
        top:-100px;
    }

    100% {
        top: 75px;
    }

}
@keyframes flow{

    0% {
        top:-100px;
    }

    100% {
        top: 75px;
    }

}

.animate-flow{
    -webkit-animation-name: flow;
            animation-name: flow;
}

我在使用 jquery 加载页面时添加类

$('.top-bar').addClass('animate-flow');

它不工作

最佳答案

以下是您可以与关键帧一起使用的所有不同属性:

animation-name:;
 animation-duration:;
 animation-iteration-count:;
 animation-direction:;
 animation-timing-function:;
 animation-fill-mode:;
 animation-delay:;

更改代码

.animate-flow{
-webkit-animation-name: flow;
        animation-name: flow;

}

例如:

.animate-flow{
    -webkit-animation: flow 3s ease-in-out;
            animation: flow 3s ease-in-out;
}

Updated FIDDLE

关于jquery - 关键帧不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20542047/

相关文章:

css3pie 从 ie7,8 中的圆形元素泄漏图像

jquery - 单击其他菜单项时如何改回并隐藏我的菜单?

html - 位置:除非给出边界,否则绝对不起作用

javascript - 撤消 jQuery 函数

javascript - 提交后清除文本框

javascript - 如何使用循环多次将 img 插入到 div 中

html - 为什么我的 CSS 动画在 Safari 中不起作用?

html - 背景幻灯片放映 Safari

javascript - Greasemonkey 快照在页面刷新后已过时?

javascript - jQuery 图像 src 淡出淡入效果