脚本宝典收集整理的这篇文章主要介绍了js实例教程-jquery重新播放css动画所遇问题解决,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。
最近在做css动画,遇到需要用脚本重新播放动画的情况。例如:
css动画代码
. 代码如下:
.seed_txt_out .seed_txt h2 {
animation-name: seed-h2;
animation-duration: 2s;
animation-timing-function: ease;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: alternate;
animation-play-state: running;
posITion: relative;
top: 10px;
}
@keyframes seed-h2
{
From {top: -120px;}
to {top: 10px;}
}
. 代码如下:
$(".seed_txt_out").children("p").removeClass("seed_txt");
$(".seed_txt_out").children("p").addClass("seed_txt");
. 代码如下:
$(opts.txt).children("p").removeClass("seed_txt");
temp = $(opts.txt).children("p:eq(" + $(this).parent("ul").children("li").index(this) + ")");
newDiv = temp.clone(true);
temp.after(newDiv);
temp.remove();
newDiv.addClass("seed_txt");
最近在做css动画,遇到需要用脚本重新播放动画的情况。例如:
css动画代码
. 代码如下:
.seed_txt_out .seed_txt h2 {
animation-name: seed-h2;
animation-duration: 2s;
animation-timing-function: ease;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: alternate;
animation-play-state: running;
position: relative;
top: 10px;
}
@keyframes seed-h2
{
from {top: -120px;}
to {top: 10px;}
}
. 代码如下:
$(".seed_txt_out").children("p").removeClass("seed_txt");
$(".seed_txt_out").children("p").addClass("seed_txt");
. 代码如下:
$(opts.txt).children("p").removeClass("seed_txt");
temp = $(opts.txt).children("p:eq(" + $(this).parent("ul").children("li").index(this) + ")");
newDiv = temp.clone(true);
temp.after(newDiv);
temp.remove();
newDiv.addClass("seed_txt");
觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!
以上是脚本宝典为你收集整理的js实例教程-jquery重新播放css动画所遇问题解决全部内容,希望文章能够帮你解决js实例教程-jquery重新播放css动画所遇问题解决所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。