簡體   English   中英

如何使用jQuery使整個菜單欄項目+區域可單擊

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

我有一個菜單欄。 我剛剛發現了一些有用的東西,可以使整個菜單欄區域都可以通過jquery單擊。

這是設計代碼:

<%@ 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>

當我單擊菜單項的區域時,如何工作正常,但是當我單擊原始菜單項時,會發生如下錯誤:

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 

我的jquery代碼有問題嗎?

- - - - - - - - - - - - - - - - - - 更新 - - - - - - - ----------------------------

這是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>

.........

您的問題在這里:

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

當您單擊a元素時, e.target本身就是a元素,因此...

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

返回一個空的jQuery對象,因為e.target沒有子元素。 如果要使用e.target,則需要執行以下操作:

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

這樣,您可以檢查是否已單擊a元素。 如果是,請使用它;否則,請使用它。 如果不是,則搜索它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM