使用 mootools 1.11 加载后 ie6 背景图像 png AlphaImageLoader 问题

发布于 2024-07-20 13:05:59 字数 443 浏览 4 评论 0原文

我试图在 mootools onclick 事件更改徽标 div 的背景图像后在 ie6 中渲染 .png 背景图像。

这是现在的相关代码 -

if(!window.ie6){
    $('logo').setStyle('background-image', imagePath);
}else{
    $('logo').setStyles({
    filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+imagePath+")"
    });
}

无论出于何种原因,这似乎不起作用! 该事件被调用并且对于所有其他浏览器都可以正常工作,但在 ie6 中运行时徽标只是空白。

如果有人能对此有所启发,或者有任何想法,我将非常感激。

干杯, 彼得

I'm trying to render a .png background image in ie6 after a mootools onclick event which changes the background image of a logo div.

here is the relevant code as it is just now-

if(!window.ie6){
    $('logo').setStyle('background-image', imagePath);
}else{
    $('logo').setStyles({
    filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+imagePath+")"
    });
}

this, for whatever reason, doesn't seem to work! the event is called and works fine for all other browsers but the logo is just blank when this runs in ie6.

If anyone could shed some light on this, or has any ideas, I would be much obliged.

Cheers,
peter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同尘 2024-07-27 13:05:59

您是否尝试过将 PNG 保存为 PNG8? 这样你就可以优雅的处理IE6了。 节省了所有阿尔法负载哈塞尔。

此外,为什么不尝试在条件样式表中编写 CSS,并且只需更改相关项目的类(或添加更多内容)而不是其内联属性。

http://www.sitepoint.com /blogs/2008/03/20/making-ie6-friend-png8-images/

have you tried saving your PNG's as PNG8 instead? this way you can gracefully handle IE6. saves all that alpha load hassel.

futher, why not try and write your css in conditional stylesheets ands simply change the class (or add more on) of the item in question rather than its inline attributes.

http://www.sitepoint.com/blogs/2008/03/20/making-ie6-friendly-png8-images/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文