开发者

My animation function is playing up

开发者 https://www.devze.com 2023-02-04 04:58 出处:网络
Hey, I have been working on this animation function for my JavaScript library for a little while now and I have found a fairly large problem.

Hey, I have been working on this animation function for my JavaScript library for a little while now and I have found a fairly large problem.

When animating any property it works fine, no problems, no errors other than the opacity. If 开发者_运维百科you go to animate the opacity nothing happens until you also animate another property.

For instance, this will not work.

Spark('p#opacity').animate({opacity: 0.5}, 1000);

But this will

Spark('p#opacity').animate({opacity: 0.5, marginTop: 1}, 1000);

So after reading through the function I linked above, have you noticed anything blatantly wrong? It is to do with all of the cross browser fixes I have had to do when animating opacity. As you can see I am having to set four types of opacity etc.


I could only get it to work by changing making sure that prefix and unit were set to '' rather than undefined or false.

It would set values like undefined.2false for the opacity. One caveat, I ran it outside of the rest of the library, so there may be something I missed.

0

精彩评论

暂无评论...
验证码 换一张
取 消