简体   繁体   English

如何使用jQuery使整个菜单栏项目+区域可单击

[英]how to make whole menu bar item + area clickable with jquery

i have one menu bar. 我有一个菜单栏。 I just found something useful thing to make whole menu bar area should be clickable with jquery. 我刚刚发现了一些有用的东西,可以使整个菜单栏区域都可以通过jquery单击。

here is design code : 这是设计代码:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuControl.ascx.cs" Inherits="MenuControl"%>
<link rel="stylesheet" href="css/Menu3.css" type="text/css" />
<div id="header" align="center" >
<script type="text/javascript" language="javascript">
$(document).ready(function() {                 
     $(".Menu").click(function(e) {
         window.location = $(e.target).find("a").attr("href");
         return false;
     });
});
</script>
<table width="100%" cellpadding ="0" cellspacing ="0" align="center">
<tr>
<td align="center">
   <asp:Menu ID="Menu1" runat="server" Orientation ="Horizontal" CssClass="Menu"
        ForeColor ="Black" Width="100%" ScrollDownText="" 
        StaticPopOutImageUrl="~/images/down_arrow_1.gif">
     <StaticMenuItemStyle Height="40px"/>
     <DynamicMenuItemStyle Height="40px" CssClass="Menu" HorizontalPadding="10px"/>
     <StaticHoverStyle CssClass="menuhover" />
     <DynamicHoverStyle CssClass="menuhover" />
    </asp:Menu>
</td>
</tr>
</table>
</div>

how ever this works fine when i click area of menu item but when i clicks original menu item then error occurs like: 当我单击菜单项的区域时,如何工作正常,但是当我单击原始菜单项时,会发生如下错误:

Server Error in '/EasyWeb' Application.
--------------------------------------------------------------------------------

The resource cannot be found. 
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /EasyWeb/undefined


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 

Is there problem with my jquery code?? 我的jquery代码有问题吗?

------------------------------------Updated----------------------------------------- - - - - - - - - - - - - - - - - - - 更新 - - - - - - - ----------------------------

here is html full markup: 这是html完整标记:

<table width="100%" cellpadding ="0" cellspacing ="0" align="center">
<tr>
<td align="center">
   <a href="#menu1_Menu1_SkipLink"><img alt="Skip Navigation Links" src="/EasyWeb/WebResource.axd?d=uS7YYfXnUXiSaHkS-NobyQ2&amp;t=635234834251287338" width="0" height="0" style="border-width:0px;" /></a><table id="menu1_Menu1" class="Menu menu1_Menu1_2" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n0"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="Default.aspx">Home</a></td>
            </tr>
        </table></td><td style="width:3px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n1"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="Register.aspx">Sign Up</a></td>
            </tr>
        </table></td><td style="width:3px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n2"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="javascript:__doPostBack('menu1$Menu1','Services')">Services</a></td><td style="width:0;"><img src="images/down_arrow_1.gif" alt="Expand Services" style="border-style:none;vertical-align:middle;" /></td>
            </tr>
        </table></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n3"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="javascript:__doPostBack('menu1$Menu1','Tools')">Tools</a></td><td style="width:0;"><img src="images/down_arrow_1.gif" alt="Expand Tools" style="border-style:none;vertical-align:middle;" /></td>
            </tr>
        </table></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n4"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="javascript:__doPostBack('menu1$Menu1','Important Links')">Important Links</a></td><td style="width:0;"><img src="images/down_arrow_1.gif" alt="Expand Important Links" style="border-style:none;vertical-align:middle;" /></td>
            </tr>
        </table></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n5"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="javascript:__doPostBack('menu1$Menu1','Acts')">Acts</a></td><td style="width:0;"><img src="images/down_arrow_1.gif" alt="Expand Acts" style="border-style:none;vertical-align:middle;" /></td>
            </tr>
        </table></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n6"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="javascript:__doPostBack('menu1$Menu1','Rules')">Rules</a></td><td style="width:0;"><img src="images/down_arrow_1.gif" alt="Expand Rules" style="border-style:none;vertical-align:middle;" /></td>
            </tr>
        </table></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n7"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="http://law.incometaxindia.gov.in/DIT/Circulars.aspx">Circulars</a></td>
            </tr>
        </table></td><td style="width:3px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n8"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="http://law.incometaxindia.gov.in/DIT/Notifications.aspx">Notification</a></td>
            </tr>
        </table></td><td style="width:3px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n9"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="http://www.incometaxindia.gov.in/allforms.asp">Forms</a></td>
            </tr>
        </table></td><td style="width:3px;"></td><td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n10"><table class="menu1_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td style="white-space:nowrap;"><a class="menu1_Menu1_1 menu1_Menu1_3" href="http://easyweb999.wordpress.com/">Blog</a></td>
            </tr>
        </table></td>
    </tr>
</table><div id="menu1_Menu1n2Items" class="menu1_Menu1_0">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n11">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Corporate Services')" style="border-style:none;font-size:1em;">Corporate Services</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n12">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Corporate Finance')" style="border-style:none;font-size:1em;">Corporate Finance</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n13">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Corporate Finance')" style="border-style:none;font-size:1em;">Corporate Finance</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n14">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Accounting Services')" style="border-style:none;font-size:1em;">Accounting Services</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n15">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Payroll')" style="border-style:none;font-size:1em;">Payroll</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n16">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Benefits of Outsourcing')" style="border-style:none;font-size:1em;">Benefits of Outsourcing</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n17">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Income Tax')" style="border-style:none;font-size:1em;">Income Tax</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n18">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Value Added Tax (VAT)')" style="border-style:none;font-size:1em;">Value Added Tax (VAT)</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n19">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\Service Tax')" style="border-style:none;font-size:1em;">Service Tax</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n20">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Services\\TDS/FBT')" style="border-style:none;font-size:1em;">TDS/FBT</a></td>
                </tr>
            </table></td>
        </tr>
    </table><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n2ItemsUp" onmouseover="PopOut_Up(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=WOcqFGSOX-4KCNzzZKFmZljtQUM9O7kD3Xq3fcz3ZVY1&amp;t=635234834251287338" alt="Scroll up" />
    </div><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n2ItemsDn" onmouseover="PopOut_Down(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=-r2DsOX_bJ0J6gpZu3I-GAcZkKhJPqAevVJdTAHh6E01&amp;t=635234834251287338" alt="" />
    </div>
</div><div id="menu1_Menu1n3Items" class="menu1_Menu1_0">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n21">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Tools\\TDS Rates for N.R.I u/s 195')" style="border-style:none;font-size:1em;">TDS Rates for N.R.I u/s 195</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n22">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Tools\\Rates of Income Tax')" style="border-style:none;font-size:1em;">Rates of Income Tax</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n23">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Tools\\Rates of NSC Interest')" style="border-style:none;font-size:1em;">Rates of NSC Interest</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n24">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Tools\\ROC Fee Structure')" style="border-style:none;font-size:1em;">ROC Fee Structure</a></td>
                </tr>
            </table></td>
        </tr>
    </table><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n3ItemsUp" onmouseover="PopOut_Up(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=WOcqFGSOX-4KCNzzZKFmZljtQUM9O7kD3Xq3fcz3ZVY1&amp;t=635234834251287338" alt="Scroll up" />
    </div><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n3ItemsDn" onmouseover="PopOut_Down(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=-r2DsOX_bJ0J6gpZu3I-GAcZkKhJPqAevVJdTAHh6E01&amp;t=635234834251287338" alt="" />
    </div>
</div><div id="menu1_Menu1n4Items" class="menu1_Menu1_0">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n25">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\PAN')" style="border-style:none;font-size:1em;">PAN</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand PAN" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n26">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\TAN')" style="border-style:none;font-size:1em;">TAN</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand TAN" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n27">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\E-Payment Online')" style="border-style:none;font-size:1em;">E-Payment Online</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand E-Payment Online" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n28">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\IncomeTax')" style="border-style:none;font-size:1em;">IncomeTax</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand IncomeTax" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n29">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\CBEC')" style="border-style:none;font-size:1em;">CBEC</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand CBEC" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n30">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\PF &amp; ESI')" style="border-style:none;font-size:1em;">PF & ESI</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand PF &amp; ESI" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n31">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\Excise and Service Tax')" style="border-style:none;font-size:1em;">Excise and Service Tax</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand Excise and Service Tax" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n32">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\MCA')" style="border-style:none;font-size:1em;">MCA</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand MCA" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n33">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\VAT')" style="border-style:none;font-size:1em;">VAT</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n34">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\CA/CS/CWA')" style="border-style:none;font-size:1em;">CA/CS/CWA</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand CA/CS/CWA" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n35">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\CIBIL')" style="border-style:none;font-size:1em;">CIBIL</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand CIBIL" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n36">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\IEPF')" style="border-style:none;font-size:1em;">IEPF</a></td><td style="width:0;"><img src="/EasyWeb/WebResource.axd?d=h5TZ_gXVB1RnNj7NTVeAgYjX6yi42JGwgXdtAbGcijc1&amp;t=635234834251287338" alt="Expand IEPF" style="border-style:none;vertical-align:middle;" /></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n37">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="javascript:__doPostBack('menu1$Menu1','Important Links\\RTI')" style="border-style:none;font-size:1em;">RTI</a></td>
                </tr>
            </table></td>
        </tr>
    </table><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n4ItemsUp" onmouseover="PopOut_Up(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=WOcqFGSOX-4KCNzzZKFmZljtQUM9O7kD3Xq3fcz3ZVY1&amp;t=635234834251287338" alt="Scroll up" />
    </div><div class="Menu menu1_Menu1_6 menu1_Menu1_0" id="menu1_Menu1n4ItemsDn" onmouseover="PopOut_Down(this)" onmouseout="PopOut_Stop(this)" style="text-align:center;">
        <img src="/EasyWeb/WebResource.axd?d=-r2DsOX_bJ0J6gpZu3I-GAcZkKhJPqAevVJdTAHh6E01&amp;t=635234834251287338" alt="" />
    </div>
</div><div id="menu1_Menu1n25Items" class="menu1_Menu1_0">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n38">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="https://incometaxindiaefiling.gov.in/e-Filing/Services/KnowYourPanLink.html" target="_blank" style="border-style:none;font-size:1em;">Know Your PAN</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n39">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="https://tin.tin.nsdl.com/tan/StatusTrack.html" target="_blank" style="border-style:none;font-size:1em;">Status Of Pan NSDL</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n40">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="http://www.myutiitsl.com/PANONLINE/panTracker.do" target="_blank" style="border-style:none;font-size:1em;">Status Of Pan UTIITSL</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n41">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="https://tin.tin.nsdl.com/pan/index.html" target="_blank" style="border-style:none;font-size:1em;">Apply Online Pan NSDL</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n42">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="http://www.utiitsl.com/" target="_blank" style="border-style:none;font-size:1em;">Apply Online Pan UTIITSL</a></td>
                </tr>
            </table></td>
        </tr><tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)" id="menu1_Menu1n43">
            <td><table class="Menu menu1_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td style="white-space:nowrap;width:100%;"><a class="menu1_Menu1_1 Menu menu1_Menu1_5" href="http://law.incometaxindia.gov.in/DITTaxmann/IncomeTaxRules/pdf/Form49aE.PDF" target="_blank" style="border-style:none;font-size:1em;">Form Apply For PAN</a></td>
                </tr>
            </table>

......... .........

Your problem is here: 您的问题在这里:

window.location = $(e.target).find("a").attr("href");

When you click the a element, then e.target becomes the a element itself, and so... 当您单击a元素时, e.target本身就是a元素,因此...

$(e.target).find('a');

returns an empty jQuery object, because e.target has not child elements. 返回一个空的jQuery对象,因为e.target没有子元素。 You need to do this, if you want to use e.target: 如果要使用e.target,则需要执行以下操作:

var $a = e.target.nodeName.toLowerCase() == 'a' ? $(e.target) : $(e.target).find('a');
window.location = $a.attr('href');

This way you check whether you've already clicked in the a element. 这样,您可以检查是否已单击a元素。 If it is, uses it; 如果是,请使用它;否则,请使用它。 if not, searches for it. 如果不是,则搜索它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM