问题描述:

Could you please help me that this code doesn't work in IE? But this one works with firefox

I think I'm missing something

Thanks

<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>

网友答案:

Maybe it's not the size of image. I had a similar issue. In my case was the extension of the image that was different from the real encoding. I had saved a jpg/png image with gif extension. All browser recognized the image in the real format (not the in the extension), but IE not.

相关阅读:
Top