网站菜单效果

<table width="100" border="0" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td align="center" class="hs12">
                                                                                    <span id="span1" onclick="Tab(1)" style="cursor: hand; color: #017F9D">--省级链接--</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td align="center" class="hs12" style="height: 20px">
                                                                                    <span id="span3" onclick="Tab(3)" style="cursor: hand; color: #000000">--区县链接--</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td align="center" class="hs12">
                                                                                    <span id="span4" onclick="Tab(4)" style="cursor: hand; color: #000000">--友情链接--</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td align="center" class="hs12">
                                                                                    <span id="span2" onclick="Tab(2)" style="cursor: hand; color: #000000">--热点链接--</span>
                                                                                </td>
                                                                            </tr>
                                                                        </table>

js部分

<script language="javascript">
                                                             function getcontrolbyid(id)
                                                                {
                                                                    return document.getElementById(id);
                                                                }
                                                               function Tab(n)
                                                                    {
                                                                        for(var i=1;i<5;i++)
                                                                        {
                                                                            if(i!=n)
                                                                            {
                                                                            //debugger
                                                                                getcontrolbyid('table'+i).style.display="none"; 
                                                                                getcontrolbyid('span'+i).style.color="#000000"; 
                                                                            }
                                                                            else
                                                                            {
                                                                                getcontrolbyid('table'+i).style.display="none";
                                                                                getcontrolbyid('span'+i).style.color="#017F9D";
                                                                            }
                                                                        }
                                                                        getcontrolbyid('table'+n).style.display="block";
                                                                    }
                                                            </script>

详细信息部分

<table id="table4" style="display: none" width="801" height="10px" align="center"
                                                                            cellpadding="2" cellspacing="2"></table>

<table id="table3" style="display: block" width="801" height="10px" align="center"
                                                                            cellpadding="2" cellspacing="2"></table>

http://www.hrbgtj.gov.cn/这底端案例

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值