Re: [問題] js問題
剛剛又檢查了一下 id命名和傳值應該都沒錯才是... IE也都一切正常
但只要用firefox就動不了.... 只好把全部程式碼貼上來 請大家幫忙了
JS新手 麻煩大家了 謝謝^^
<html>
<head>
<title>TEST</title>
<style type="text/css">
.bdivwh{
width:640px;
height:480px;
margin-top:-350px;
font-size:24px;
border:solid;
background-image:url("1.jpg"); display:none;
}
.sdivwh{
width:112px;
height:45px;
}
.tdivtl{
margin-top:-1px;
margin-left:40px;
}
.t1{
margin-top:140px;
margin-left:40px;
background-image:url("t1.jpg");
}
.t2{
background-image:url("t2.jpg");
}
.t3{
background-image:url("t3.jpg");
}
.t4{
background-image:url("t4.jpg");
}
.t5{
background-image:url("t5.jpg");
}
.t6{
background-image:url("t6.jpg");
}
.t7{
background-image:url("t7.jpg");
}
</style>
<script language="javascript">
<!--
var i=0;
var id;
function chang(id){
for(i=1;i<=7;i++){
if(i == id){
document.getElementById(i).style.display="inline";
}else{
document.getElementById(i).style.display='none';
}
}
}
//-->
</script>
</head>
<body>
<div class="sdivwh t1" onmouseover="chang(1);"></div>
<div class="sdivwh t2 tdivtl" onmouseover="chang(2);"></div>
<div class="sdivwh t3 tdivtl" onmouseover="chang(3);"></div>
<div class="sdivwh t4 tdivtl" onmouseover="chang(4);"></div>
<div class="sdivwh t5 tdivtl" onmouseover="chang(5);"></div>
<div class="sdivwh t6 tdivtl" onmouseover="chang(6);"></div>
<div class="sdivwh t7 tdivtl" onmouseover="chang(7);"></div>
<center>
<div class="bdivwh" id="1" style="display:block">1</div>
<div class="bdivwh" id="2">2 </div>
<div class="bdivwh" id="3">3 </div>
<div class="bdivwh" id="4">4 </div>
<div class="bdivwh" id="5">5 </div>
<div class="bdivwh" id="6">6 </div>
<div class="bdivwh" id="7">7 </div>
</center>
</body>
</html>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.233.68.89
推
11/20 21:07, , 1F
11/20 21:07, 1F
推
11/20 21:19, , 2F
11/20 21:19, 2F
推
11/20 21:21, , 3F
11/20 21:21, 3F
討論串 (同標題文章)
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章