如何在asp.net中添加子链接 [英] how to add sub links in asp.net

查看:83
本文介绍了如何在asp.net中添加子链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<table>
<tr>
<td>
<a href="home.aspx">home</a>

</td>
</tr>
</table>





当我搬家时光标在链接上它将显示该链接下的超链接



有谁能告诉我该怎么做..



When I move the cursor over the link it will show hyperlinks under that link

Could anyone tell me how to do this..

推荐答案

试试这些



http:// forums。 asp.net/t/1521174.aspx [ ^ ]



ASP .NET水平菜单控件 [ ^ ]
Try these

http://forums.asp.net/t/1521174.aspx[^]

ASP.NET Horizontal Menu Control[^]


尝试这样..

你可以自定义它。通过添加CSS





try like this..
you can customize it. by adding css


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="jquery.js.js"></script>

    <script type="text/javascript">
        var overfn = function () {
            document.getElementById('sublinks').style.display = 'block';

        }
        var outfn = function () {
            document.getElementById('sublinks').style.display = 'none';
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">


        <table>
            <tr>
                <td>

                    <ul style="list-style-type: none;" onmouseover="overfn()" onmouseout="outfn()">
                        <li><a href="home.aspx">home</a></li>
                        <li>
                            <ul id="sublinks" style="display: none">
                                <li><a href="home.aspx">one</a></li>
                                <li><a href="home.aspx">two</a></li>
                                <li><a href="home.aspx">three</a></li>
                                <li><a href="home.aspx">four</a></li>
                            </ul>
                        </li>
                    </ul>



                </td>
            </tr>
        </table>




    </form>

</body>
</html>


你可以在JavaScript / jQuery或CSS的帮助下完成。





JavaScript / jQuery



在该链接的悬停事件中触发一个并动态创建新链接并在链接后追加该链接。





CSS



放置一个包含所有其他链接的div,最初隐藏按样式显示无。悬停在链接上时,只需调用一个事件并删除样式显示无。
You can do it with the help of JavaScript/ jQuery or CSS.


JavaScript/jQuery

Fire one on hover event for that link and create new links dynamically and append that after the link.


CSS

Place one div with all other links and initially hide that by style display none. While hovering on the link, just call one event and remove style display none.


这篇关于如何在asp.net中添加子链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆