联动菜单

本文介绍了一个使用JavaScript实现的图片悬停显示不同内容的效果。当鼠标悬停在不同的图片上时,会触发相应的JavaScript函数改变页面元素的显示状态,并跳转到特定的链接。

js部分

 function over()
    {
        document.getElementById("ywxx").style.display="none";
        document.getElementById("zxgz").style.display="block";
        document.getElementById("rdzt").style.display="none";
        //document.getElementById("yw").src="images/index_22xx1.gif";
        //document.getElementById("zx").src="images/index_22zx.gif";
        document.getElementById("hl").href="LaborSupervise/PunishAndCreditList.aspx?TypeId=21";
    }
   
    function out()
    {
        document.getElementById("ywxx").style.display="block";
        document.getElementById("zxgz").style.display="none";
        document.getElementById("rdzt").style.display="none";
        //document.getElementById("yw").src="images/index_22xx.gif";
        //document.getElementById("zx").src="images/index_22zx2.gif";
        document.getElementById("hl").href="MineAndOperationArticle/ArticleListTWO.aspx?type=2";
    }
    function move()
    {
        document.getElementById("ywxx").style.display="none";
        document.getElementById("zxgz").style.display="none";
        document.getElementById("rdzt").style.display="block";
        //document.getElementById("yw").src="images/index_22xx.gif";
        //document.getElementById("zx").src="images/index_22zx2.gif";
        document.getElementById("hl").href="Default.aspx";
    }

源码

 <td class="ch12" style="width: 550px; height: 32px;" background="images/index_220bj.gif">
                                                            <img id="yw" src="images/1.gif" onmouseover="out()" /><img id="zx" src="images/2.gif"
                                                                onmouseover="over()" /><img id="rd" src="images/3.gif" onmouseover="move()"/>
                                                        </td>

特效

<tr id="zxgz" style="display:none;">
                                                        <td width="127" style="height: 123px">
                                                            <table width="110" height="79" border="0" cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td width="105" background="images/index_48.gif">
                                                                        <table width="90" height="79" border="0" align="center" cellpadding="0" cellspacing="0">
                                                                            <tr>
                                                                                <td width="90" height="58" align="center">
                                                                                    <a href="LaborSupervise/PunishAndCreditList.aspx?TypeId=21" class="hs12">
                                                                                        <img src="images/bszx_01.gif" border="0" width="68" height="52"></a></td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td height="15" align="center" valign="middle" class="hs12">
                                                                                    <a href="LaborSupervise/PunishAndCreditList.aspx?TypeId=21" class="hs12">第二次土地调查</a></td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                        <td width="127" colspan="5">
                                                            <table width="110" height="79" border="0" cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td width="105" background="images/index_48.gif">
                                                                        <table width="80" height="79" border="0" align="center" cellpadding="0" cellspacing="0">
                                                                            <tr>
                                                                                <td width="80" align="left" style="height: 58px">
                                                                                    <a href="LaborSupervise/PunishAndCreditList.aspx?TypeId=25" class="hs12">
                                                                                        <img src="images/bszx_02.gif" border="0" width="68" height="52"></a></td>
                                                                            </tr>
                                                                            <tr align="center">
                                                                                <td height="15" align="center" valign="middle" class="hs12">
                                                                                    <a href="LaborSupervise/PunishAndCreditList.aspx?TypeId=25" class="hs12">&nbsp;&nbsp;金土工程</a></td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值