在Wordpress网站中使用关键帧进行CSS动画/转换

时间:2014-08-04 18:46:38

标签: css wordpress css-transforms css-animations

我的CSS动画有一些问题,但有两个很好用。他们都很好地工作,但是当我把它放在我的wordpress页面上时,两个人都工作了。有谁知道问题是什么?

我的CSS(仅适用于doesen工作的动画):

.start{
-webkit-animation-name: start;
-webkit-animation-duration: 2000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-play-state: running;
-webkit-animation-direction: reverse;

-moz-animation-name: start;
-moz-animation-duration: 2000ms;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: ease-in-out;
-moz-animation-play-state: running;
-moz-animation-direction: reverse;

-ms-animation-name: start;
-ms-animation-duration: 2000ms;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: ease-in-out;
-ms-animation-play-state: running;
-ms-animation-direction: reverse;

animation-name: start;
animation-duration: 2000ms;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-play-state: running;
animation-direction: reverse;


}

@-ms-keyframes start {
from { -ms-transform: translateX(0px); }
50% { -ms-transform: translateX(-100px); }
to { -ms-transform: translateX(0px); }
}
@-moz-keyframes start {
from { -moz-transform: translateX(0px); }
50% { -moz-transform: translateX(-100px); }
to { -moz-transform: translateX(0px); }
}
@-webkit-keyframes start {
from { -webkit-transform: translateX(0px); }
50% { -webkit-transform: translateX(-100px); }
to { -webkit-transform: translateX(0px); }
}
@keyframes start {
from {
    transform: translateX(0px);
}
50% { 
transform: translateX(-100px); 
}
to {
    transform: translateX(0px);
}
}


/*************************
Animationer - stop
**************************/


.stop{
-webkit-animation-name: start;
-webkit-animation-play-state: paused;

-moz-animation-name: start;
-moz-animation-play-state: paused;

-ms-animation-name: start;
-ms-animation-play-state: paused;

animation-name: start;
animation-play-state: paused;
}

1 个答案:

答案 0 :(得分:0)

对不起,有点睡觉让我很好。发现我的javascript代码只是有点不对劲。不知道为什么它在我的cumputer(在wordpress之外)仍然有效,但至少我现在发现了问题!