【问题标题】:gif and png Images disappear on IE8 onlygif 和 png 图像仅在 IE8 上消失
【发布时间】:2012-07-10 15:31:15
【问题描述】:

我的 6 张图片(悬停时的 png 和动画 gif)无法仅在 IE8 上加载,我已经在 mac 和 windows 上的大多数浏览器上进行了测试,而 IE8 是唯一无法加载图片的浏览器。它们实际上出现在 IE7 上,我一直在网上查看解决方案或类似问题,但似乎找不到合适的解决方案。

这是该页面的链接:http://tinyurl.com/8ydbp6y

这是该特定部分的 html

    <ul class="about-icons">
         <li id="about-love"><a href="includes/content/content-love.html" target="content-load"><img src="images/about/icon-thankyou.png" onmouseover="this.src='images/about/icon-thankyou.gif'" onmouseout="this.src='images/about/icon-thankyou.png'"/></a></li>
          <li id="about-japan"><a href="includes/content/content-japan.html" target="content-load"><img src="images/about/icon-japan.png" onmouseover="this.src='images/about/icon-japan.gif'" onmouseout="this.src='images/about/icon-japan.png'"/></a></li>
       <li  id="about-icecream" class="no-margin-right"><a href="includes/content/content-icecream.html" target="content-load"><img src="images/about/icon-icecream.png" onmouseover="this.src='images/about/icon-icecream.gif'" onmouseout="this.src='images/about/icon-icecream.png'"/></a></li>
    </ul> 
    <br/>  
    <div id="about-whymochiko" ><img src="images/about/whymochiko.png" alt="Why Mochiko"/></div>
    <br/>
    <ul class="about-icons">
       <li id="about-flavors"><a href="includes/content/content-flavors.html" target="content-load"><img src="images/about/icon-flavors.png" onmouseover="this.src='images/about/icon-flavors.gif'" onmouseout="this.src='images/about/icon-flavors.png'"/></a></li>
       <li id="about-ingredients"><a href="includes/content/content-ingredients.html" target="content-load"><img src="images/about/icon-ingredients.png" onmouseover="this.src='images/about/icon-ingredients.gif'" onmouseout="this.src='images/about/icon-ingredients.png'"/></a></li>
       <li id="about-milk" class="no-margin-right"><a href="includes/content/content-milk.html" target="content-load"><img src="images/about/icon-milk.png" onmouseover="this.src='images/about/icon-milk.gif'" onmouseout="this.src='images/about/icon-milk.png'"/></a></li>
    </ul>`

提前致谢!

编辑 我检查了 IE8 图像报告,显然它将图像的宽度和高度调整为 0px。我不知道为什么会这样:|我不知道如何解决它

【问题讨论】:

    标签: image internet-explorer-8 onmouseover onmouseout


    【解决方案1】:

    我认为这可能是带有 JavaScript 的 IE 中的一个错误。一个可能的解决方案是加载图像,然后使用 JavaScript 切换动画可见性?

    【讨论】:

    • 谢谢!但不幸的是,这不是 javascript 错误 :( 我尝试了您推荐的内容,但图像仍然丢失。我检查了开发人员工具(图像报告),显然 IE8 自动将我的高度和宽度从原始尺寸重新调整为 0px。我我不知道为什么它特别发生在 IE8 上
    • 啊!尝试将 IE8 设置为 quirks 模式。
    • 谢谢 :) 图像终于加载了,但它们到处都是哈哈。似乎将 !important 放在与这六个单独的 css 文件相关的所有 css 声明上是可行的,但不知道为什么当我在主 css 文件上添加 !important 时它不起作用
    • :D 很高兴您找到了解决方案!我认为 IE8 一定认为它知道得更好,并且出于某种原因压倒了你......
    猜你喜欢
    • 2011-01-11
    • 2017-09-15
    • 2019-01-20
    • 2017-05-29
    • 2012-01-03
    • 2019-02-06
    • 2023-04-04
    相关资源
    最近更新 更多