freelance, web developer, web designer, hosting, domain name
หลักการทำงาน คือ มีรูปใหญ่หนึ่งรูป แล้วมีรูปเล็กหลาย ๆๆ รูป พอคลิ๊กที่รูปเล็กแล้วรูปใหญ่เปลี่ยนโดย document.images['large'].src="image/001.jpg"; ซึ่งใน browser ตัวอื่นทำงานได้ค่ะ แต่ว่าถ้าเป็น IE6 รูปจะไม่ขึ้นค่ะ ต้องคอยคลิ๊ก show picture ตลอดเลยค่ะ
ลองแล้วค่ะ ยังไม่ได้เลย เป็นเพราะอะไรค่ะ
ดูให้ดีว่ามีอะไรผิดหรือเปล่า ทดสอบแล้วทำงานได้แน่ๆ <img id="img-large" alt="" />
<img src="http://www.goragod.com/smalllogo.gif" onclick="document.getElementById('img-large').src='http://www.goragod.com/smalllogo.gif'" alt="" />
<tr align="left" valign="top">
<td align="center"><img src="images/001-Big.jpg" name="large" width="488" height="346" id="large" /></td>
</tr>
<tr align="left" valign="top">
<td> </td>
</tr>
<tr align="left" valign="top">
<td>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/001.jpg" width="171" height="121" class="img_news" style="cursor:pointer;" onclick="document.images['large'].src= 'images/001-Big.jpg'" /></td>
<td> </td>
<td><img src="images/002.jpg" width="171" height="121" class="img_news" style="cursor:pointer;" onclick="document.images['large'].src= 'images/002-Big.jpg'" /></td>
<td> </td>
<td><img src="images/003.jpg" width="171" height="121" class="img_news" style="cursor:pointer;" onclick="document.images['large'].src= 'images/003-Big.jpg'" /></td>
</tr>
</table></td>
</tr>
</table>
จากโค๊ดเวลาคลิ๊กที่รูปเล็กแล้วรุปใหญ่จะเปลี่ยนตามน่ะค่ะ โดยใช้วิธี document.images['large'].src="path ของรูปใหญ่";
ซึ่งใน browser ตัวอื่นทำงานได้ค่ะ แต่ว่าถ้าเป็น IE6 รูปจะไม่ขึ้นค่ะ ต้องคอยคลิ๊ก show picture ตลอดเลยค่ะ พอจะมีวิธีไหน
บ้างค่ะให้สามารถแสดงผลใน IE6
<img id="img-large" alt="" />
<img src="xxx.jpg" onclick="document.getElementById('img-large').src='large-xxx.jpg'" alt="" />
ลองแล้วค่ะ ยังไม่ได้เลย เป็นเพราะอะไรค่ะ
ดูให้ดีว่ามีอะไรผิดหรือเปล่า ทดสอบแล้วทำงานได้แน่ๆ
<img id="img-large" alt="" />
<img src="http://www.goragod.com/smalllogo.gif" onclick="document.getElementById('img-large').src='http://www.goragod.com/smalllogo.gif'" alt="" />