【问题标题】:image in IE doesn't displayIE中的图片不显示
【发布时间】:2023-03-31 09:04:02
【问题描述】:

你能帮我看看这段代码在 IE 中不起作用吗?但是这个适用于firefox 我想我错过了什么

谢谢

<html>
<head>
<title>tintin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css"> 
#tintin{
position: relative;
top: 100px;
left: 100px;
font-size:18pt;
color:white;
font-style:bold;
font:Calibri;
filter:alpha(opacity=0);
opacity:0;}
</style>
<script type="text/javascript"> 

var txt=['text 1','text 2', 'text 3', 'text 4', 'text 5', 'text 6', 'text 7', 'text 8', 'text 9', 'text 10'], init=0,i=0,k=0,speed=50,el;
var loopCount=6;
var j=0;
function fade(){
init==0?i++:i--;
el.filters?el.style.filter='alpha(opacity='+i+')':el.style.opacity=i/100;
el.firstChild.nodeValue=txt[k];
if(i==100)init=1;
if(i==0) {init=0;k++;j++;} 
if(k==txt.length)k=0;
if (j<loopCount) setTimeout('fade()',speed);
}
window.onload=function(){
el=document.getElementById('tintin');
fade();
}
</script>
</head>
<body>
<div id="tintin">&nbsp;</div>
</div>
<div class="image">
  <img alt="" src="test.jpg" />
</div>

</body>
</html>

【问题讨论】:

  • 究竟是什么不起作用?怎么了?你得到什么错误?
  • 先提一下你愿意用你的代码做什么?
  • @Viswanathan Iyer:我希望图像在 IE 8 中显示。在 IE 9 中它可以在 Firefox 中工作。现在我找到了答案。我有一个 2 MB 的 jpg,据我所知,IE 8 无法处理这样的大小。所以我压缩了图片,现在它在两个浏览器中都显示了。很抱歉这个反复的问题。我实际上是在这里发帖的:如果你能看到stackoverflow.com/questions/5880037/… 我想让文字从左到右出现,但就像一个圆周运动
  • 那么它可能是 CMYK 图像。大小应该不是问题
  • @Pekka:如何将文本颜色更改为简单的白色?

标签: javascript html image internet-explorer firefox


【解决方案1】:

也许不是图片的大小。我有一个类似的问题。在我的情况下,图像的扩展与实际编码不同。我保存了一个带有 gif 扩展名的 jpg/png 图像。所有浏览器都能识别出真实格式的图片(不是扩展中的),但 IE 不能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-02
    • 1970-01-01
    • 2017-10-04
    • 2015-08-21
    • 2019-08-11
    • 2012-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多