动画功能和 Internet Explorer
我知道这是一个很遥远的事情,因为它是一个很大的剧本,我怀疑有人会想读完所有这些但是就这样了。
我有一个动画函数,可以对元素列表的样式属性进行动画处理。此函数可以在此处找到。现在我了解了有关跨浏览器不透明度的所有信息,并且可以手动设置它,即我可以将元素的不透明度设置为 0.5(在 IE 中为 50),并且它在每个浏览器中都能完美运行。就在我尝试通过我的函数为我的不透明度属性设置动画时,它不会移动。
正如您在其中看到的,我有很多代码只是为了让 IE 的 alpha(opacity=x)
方法正常工作。
有关示例,请参阅此小提琴。抱歉事情这么乱。如果您在 IE 以外的任何浏览器中单击显示Fade to .5 opacity on click.
的段落标记,它会淡入到 0,而不是 0.5,因为我正在测试内容。现在,如果您在 IE 中单击相同的标签,则不会发生任何事情。
我怀疑任何人都能够帮助解决如此复杂和具体的问题,但任何建议将不胜感激。
I know this is a long shot because it is a large script and I doubt anyone will want to read through all this but here it goes.
I have an animation function that animates the style properties of a list of elements. This function can be found here. Now I know all about cross browser opacity and I can set it manually i.e. I can set the opacity of an element to .5 (50 in IE's case) and it works perfect in every browser. Just when I try to animate my opacity property through my function it does not move.
As you can see in there I have a lot of code just to get IE's method of alpha(opacity=x)
working.
For an example of it please see this fiddle. Sorry about it being so messy. If you click the paragraph tag that says Fade to .5 opacity on click.
in any browser other than IE it will fade to 0, not .5 because I am testing stuff. Now if you click the same tag in IE nothing happens.
I doubt anyone will be able to help with such a complicated and specific problem but any suggestion will be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您在
css()
和animate()
中实现了两次不透明度逻辑。在我看来,无论你多么追求高性能,这都是糟糕的设计。修复此问题后,animate()
将依赖于有效的css()
函数,并且由于该函数有效,animate()
将起作用。Looks like you're implementing your opacity logic twice, both in
css()
andanimate()
. That's bad design IMO no matter how much you're aiming for high performance. Once you fix that,animate()
will be dependant on a workingcss()
function, and since that works,animate()
will work.