<a> Tag not working when used in JQuery</a>

时间:2013-04-02 12:47:44

标签: jquery-ui

我使用普通的树结构来表示jQuery中的表单。但是,当我点击某些<Li>打开新页面时,它无法打开...

  $(document).ready(function()  
  {
     $("#treeMenu li").click(function(e)
      {  e.preventDefault();
       });
   $("#treeMenu li").toggle( function()
 { // START FIRST CLICK FUNCTION
    $(this).children('ul').slideDown()
   if($(this).hasClass('contentContainer'))                                                   {$(this).removeClass('contentContainer').addClass('contentViewing');
   }
  }, // END FIRST CLICK FUNCTION

  function() { // START SECOND CLICK FUNCTION
  $(this).children('ul').slideUp()
  if ($(this).hasClass('contentViewing')) {
  $(this).removeClass('contentViewing').addClass('contentContainer');
   }
   } // END SECOND CLICK FUNCTIOn
   ); // END TOGGLE FUNCTION
   }); // END DOCUMENT READY

<ul  id="treeMenu">
    <li class="contentContainer" >MASTERS
    <ul style="display: none">  
    <li class="contentContainer">Regions
     <ul style="display: none"> 
   <li><a href="zone.php">Zone</a></li>
<li><a href="division.php">Division</a></li>
<li><a href="branches.php">Branch</a>   </li>   
</ul>
</li>
</ul>
</li>
<li><a href="agency.php">Agencies</a></li>
<li><a href="doctors.php" >Doctor</a></li>
<li><a href="plan.php" >Plan</a></li>
<li><a href="location.php" >Location</a></li>
<li><a href="companygl.php" >CompanyGlCodes</a></li>        
<li class="contentContainer">SERVICING
<ul style="display: none">  
  <li class="contentContainer">Party Management
 <ul style="display: none"> 
  <li><a href="pmparties.php">Parties</a></li>
   <li><a href="pmmembers.php">Members</a></li>
</ul>
</li>       
</ul>
<ul style="display: none">  
  <li class="contentContainer">Policy Management
 <ul style="display: none"> 
<li><a href="pmpolicies.php">Policies</a></li>
<li><a href="pmpredep.php">Premium Deposit</a></li>
</ul>

</li>           
<ul style="display:none">   
  <li class="contentContainer">Commission Management
 <ul style="display: none"> 
 <li><a href="cmcommrec.php"><span>Commission Received </span></a></li>
 <li><a href="cmbonuscomm.php"><span>Bonus Commission</span></a></li>
<li><a href="cmdedcomm.php"><span>Deduction on Commission</span></a>    </li>   
    </ul>
   </li>
  </ul>
 </li>
</ul>   

当我删除jQuery时<Li>有效,但是当我为树效果添加jQuery时,它不起作用。

0 个答案:

没有答案