I have a click event on an `ul`. With `$.inArray` I want to get the current index of the `li`. With this I can then animate the right div. My Markup is like so:

```
<div class="nav">
    <ul>
        <li></li>
        <li></li>
    </ul>
</div>
<div class="sideways">
</div>
<div class="sideways">
</div>

```

And so on. You can swipe through the "sideways" divs and with the `ul` it's possible to also navigate to the divs through a navigation. Now my code looks like this:

```
$('.nav ul li').click(function(){
    $this = $(this);
    k = $.inArray($this, $('.nav ul li'));
});

```

k always returns -1. Why does this happen? Why doesn't it return the current index?