jquery 获取css3动画animation的值,改变animation的值问题

html-css09

jquery 获取css3动画animation的值,改变animation的值问题,第1张

把上面的

$(this).css("animation","running")

改成

$(this).css("animation-play-state","running")

试一下

你确定你测试的浏览器兼容animation样式吗?

还有你有微animation写@keyframes吗?

<script type="text/javascript">

$(document).ready(function() {

$("input").click(function() {

$(this).hide().fadeIn(700).addClass('b')//当前这个input先隐藏再渐显,你可以测试一下,如果不是你想要的效果,你可以查一下jq的渐隐效果函数或者animate()函数,控制这个input的透明度就好了,例如 $(this).animate(‘opacity’,‘0’);

//点击text增加b效果

$("body").one("click", function() {

$("input").removeClass("b")

//点击其他地方消除b效果

})

return false

})

})

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

<script type="text/javascript" src="jquery-1.8.3.min.js"></script>

</head>

<body>

<div class="box"></div>

<script type="text/javascript">

var htmls = '<a href="javascript:void(0)">这就是爱</a>',html=''

for(var i=0i<10i++){

html+=htmls+i

}

$(".box").html(html)

$(".box a").eq(2).attr("href","#2d")

</script>

</body>

</html>