看了下,应该是css下面这段不起作用:@-webkit-keyframes sparkle { from {background-position:0 0;} to {background-position:0 -64px;} } @-moz-keyframes sparkle { from {background-position:0 0;} to {background-position:0 -64px;} } @-o-keyframes sparkle { from {background-position:0 0;} to {background-position:0 -64px;} } @keyframes sparkle { from {background-position:0 0;} to {background-position:0 -64px;} }
IE和360都不行,只有火狐正常,test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body><script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="lj.css"><div class="progressbar" data-perc="100">
<div class="bar"><span></span></div>
</div><div class="progressbar" data-perc="75">
<div class="bar color2"><span></span></div>
</div><div class="progressbar" data-perc="50">
<div class="bar color3"><span></span></div>
</div><div class="progressbar" data-perc="35">
<div class="bar color4"><span></span></div>
</div><script type="text/javascript">
$(function() {
$('.progressbar').each(function(){
var t = $(this),
dataperc = t.attr('data-perc'),
barperc = Math.round(dataperc*2.98);
t.find('.bar').animate({width:barperc}, dataperc*20);
});
});
</script></body>
</html>
from {background-position:0 0;}
to {background-position:0 -64px;}
}
@-moz-keyframes sparkle {
from {background-position:0 0;}
to {background-position:0 -64px;}
}
@-o-keyframes sparkle {
from {background-position:0 0;}
to {background-position:0 -64px;}
}
@keyframes sparkle {
from {background-position:0 0;}
to {background-position:0 -64px;}
}