title: jquery position function for inner(nested) li returns zero
body: <p>I have nested li, which is for horizontal subnav menu. I am trying to get the position of li of child li using jquery's position() function but it is returning zero always. Same function is working for parent li. </p>
  
  <p>Html Code</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;test&lt;/title&gt;
          &lt;script type='text/javascript' src='js/jquery-1.4.2.js'&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="css/menu_style.css" type="text/css" /&gt;
          &lt;script&gt;
              $(window).load(function() {
                  jQuery(document).ready(function() {
                      jQuery('.addchar').live('click', function(event) {
                          var position = $(this).position();
                          alert(position.left);
                      });
                  });
              });
          &lt;/script&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;div id="content"&gt;
              &lt;div class="menu" id="menu"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#" class="addchar"&gt;A&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="#" class="addchar"&gt;Aword&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;&lt;a href="#" class="addchar"&gt;B&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="#" class="addchar"&gt;Bword &lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>CSS CODE</p>
  
  <pre><code>.menu{
      border:none;
      border:0px;
      margin:0px;
      padding:0px;
      position:relative;/*should be relative*/
      font-size:16px;
      font-weight:bold;
  }
  .menu ul{
      background:#333333;
      height:40px;
      list-style:none;
      margin:0;
      padding:0;
      width:900px;
  }
  
  .menu li{
      float:left;
      padding:0px;
      width:28px;
      font-size:16px;
  }
  .menu li a{
      background:#333333 url("../img/seperator.gif") bottom right no-repeat;
      color:#cccccc;
      display:block;
      font-weight:normal;
      font-size:14px;
      line-height:35px;
      margin:0px;
      padding:0px 12px;
      text-align:center;
      text-decoration:none;
  }
  .menu li a:hover, .menu ul li:hover a{
      background: #2580a2 url("../img/hover.gif") bottom center no-repeat;
      color:#FFFFFF;
      text-decoration:none;
  }
  .menu li ul{
      background:#333333;
      display:none;
      height:auto;
      padding:0px;
      margin:0px;
      border:0px;
      position:absolute;
      width:900px;
      float:right;
      z-index:200;
  }
  .menu li:hover ul{
      display:block;
  
  }
  .menu li li {
      background:url('../img/sub_sep.gif') bottom left no-repeat;
      display:block;
      margin:0px;
      padding:0px;
      width:36px;
  }
  .menu li:hover li a{
      background:none;
  
  }
  .menu li ul a{
      display:block;
      height:35px;
      font-size:14px;
      font-style:normal;
      margin:0px;
      padding:0px 10px 0px 15px;
      text-align:left;
  }
  .menu li ul a:hover, .menu li ul li:hover a{
      background:#2580a2 url('../img/hover_sub.gif') center left no-repeat;
      border:0px;
      color:#ffffff;
      text-decoration:none;
  }
  </code></pre>