剛在看橘子速銷這網站,首頁左邊有排選單,在 Fx 下點了沒用,要用 Opera 點擊才會展開,不知道是不是 getElementsByName 的問題?
下面是可能相關的原始碼:
HTML
代碼:
<table id="#T02" style="text-align: center;" width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td><a href="#T02" onclick="doOpen(2)"><img alt="[Image]" ilo-full-src="http://www.orangenet.com.tw/images/menuLeft/M_left_number.jpg" src="m_left_number.jpg" border="0"></a></td>
</tr>
</tbody></table>
<table id="sh2" style="display: none;" class="menuLeft3" width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td><a href="http://www.orangenet.com.tw/product/prod_list.asp?act=search&sFrom=2&sDept_ID=66">台灣大一元專區</a></td></tr><tr><td><a href="http://www.orangenet.com.tw/product/prod_list.asp?act=search&sFrom=2&sDept_ID=71">遠傳一元專區</a></td></tr><tr><td><a href="http://www.orangenet.com.tw/product/prod_list.asp?act=search&sFrom=2&sDept_ID=74">超值新機</a></td></tr>
</tbody></table>
JS
代碼:
<!-- //表格縮放
function doOpen(num)
{
obj1 = document.getElementsByName("sh"+num)
if(obj1[0].style.display=="") {
for (var i=0;i<obj1.length;i++)
{
obj1[i].style.display="none";
}
}
else {
for (var i=0;i<obj1.length;i++)
{
obj1[i].style.display="";
}
}
}
// -->