在 IE 中具有透明度的 jQuery 循环插件
经过大量搜索,我设法找到这两个 Cycle 插件选项,以允许 Internet Explorer 中的透明度 cleartype: true,cleartypeNoBg: true,
我现在遇到的问题是图像周围有一个黑块,在反弹过渡期间出现,然后在过渡完成并且图像位于框架中后被删除。这只发生在 IE 上。
关于如何解决这个问题有什么想法吗?
After much searching I managed to find these two Cycle plugin options to allow for transparency in Internet Explorer cleartype: true, cleartypeNoBg: true,
The problem I'm getting now is a black block thing around the image that appears during the bounce transition than gets removed once the transition is complete and the image is sitting in the frame. It's only happening on IE.
Any ideas on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
阅读 文档 似乎 clearTypeNoBG 执行以下操作与您的想法相反:它告诉插件不要纠正 IE 下的透明度。将其保留为 false。 cleartype 会自动分配值 !$.support.opacity,并且也应该保持不变。
换句话说,您通过在 true 上设置 cleartype(即 !$.support.opacity)来告诉插件浏览器不支持不透明度 然后你告诉它不要通过将 clearTypeNoBG 设置为 true 来纠正这个缺点。
Reading the documentation it seems that clearTypeNoBG does the opposite of what you think: it tells the plugin to NOT correct for transparency under IE. Leave it on false. cleartype is automatically assigned the value !$.support.opacity and should also be left alone.
In other words, you're telling the plugin that the browser doesn't support opacity by setting cleartype, which is !$.support.opacity, on true and then you're telling it to not correct for this shortcoming by setting clearTypeNoBG on true.
我编辑了 jQuery Cycle 的核心并搜索了函数
$.fn.cycle.commonReset
。我已注释掉
opts.cssBefore.opacity = 1;
。我知道这不是最好的解决方案,但它对我有用,因为我使用
scrollHorz
过渡。I edited the core of jQuery cycle and searched for function
$.fn.cycle.commonReset
.I've commented out
opts.cssBefore.opacity = 1;
.I know this is not the best solution but it works for me since I use the
scrollHorz
transition.尽管我的图像没有明确具有任何透明度,但我在淡入淡出过渡期间看到了白色块。
我通过使用图像编辑器(在我的例子中是 Photoshop)在图像上方添加一个设置为 2% 不透明度的全白色图层解决了这个问题。将其另存为 jpg,问题就消失了。
I was seeing white blocks during the fade transition, even though my image didn't explicitly have any transparency.
I solved the problem by using an image editor (photoshop in my case) to add a full white layer set to 2% opacity above the image. Saved it out as a jpg and the issue went away.