else {
oattr = parseInt(getStyle(obj,attr));
}
var speed = (json[attr]-oattr)/8;
speed = speed >0?Math.ceil(speed):Math.floor(speed);
if (oattr != json[attr]) {
flag = false;
oattr = parseInt(getStyle(obj,attr));
}
var speed = (json[attr]-oattr)/8;
speed = speed >0?Math.ceil(speed):Math.floor(speed);
if (oattr != json[attr]) {
flag = false;
2015-02-02
function startMove (obj,json,fn) {
clearInterval(obj.timer);
obj.timer = setInterval(function () {
var flag = true;
for(var attr in json){
var oattr = 0;
if (attr == 'opacity') {
oattr = Math.round(parseFloat(getStyle(obj,attr))*100);
}
clearInterval(obj.timer);
obj.timer = setInterval(function () {
var flag = true;
for(var attr in json){
var oattr = 0;
if (attr == 'opacity') {
oattr = Math.round(parseFloat(getStyle(obj,attr))*100);
}
2015-02-02
老师思路很清晰,我觉得我学的挺快啊。讲的真棒,另外有童鞋说jQuery一行代码搞定了,是的,没错,但是咱学js不就是想学学原生的js的思想吗?能学到不错的动画知识就很不错了。
2015-01-21