0
請問你能幫我看看這段代碼在IE中不起作用嗎?但這一工作與Firefox 我想我失去了一些東西在IE中的圖像不顯示
感謝
<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"> </div>
</div>
<div class="image">
<img alt="" src="test.jpg" />
</div>
</body>
</html>
究竟什麼不行?怎麼了?你會得到什麼錯誤? – 2011-05-04 08:39:17
首先提到你願意用你的代碼做什麼? – 2011-05-04 08:42:56
@Viswanathan Iyer:我想將圖像顯示在IE 8中。在IE 9中它可以工作,並且可以在Firefox中使用。現在我找到了答案。我有一個2 MB的JPG和據我所知IE 8不能處理這樣的大小。所以我壓縮了圖片,現在它在兩個瀏覽器中都顯示出來了。對於這個重複的問題抱歉。我實際上發佈在這裏:如果你可以看到http://stackoverflow.com/questions/5880037/text-in-a-clockwise-direction-using-javascript我想從左到右出現的文字,但像在一個圓形運動 – tintincutes 2011-05-04 08:58:53