Why don't you use this syntax so .each() would pass the current index for you...

$( calculationsArray ).each(function( INDEX ){

----
Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



On Fri, Mar 20, 2009 at 5:29 PM, hybris77 <dist...@yahoo.com> wrote:
>
> hi folks, if anyone could direct me in the right direction here I'd be
> very happy
>
> what's wrong here :
>
> $( calculationsArray ).each(function(){
>        var index = $( calculationsArray ).index(this);
>        $( ".calculations_list" ).append( "<li
> class='calculations_menu_list'>"+ (index+1)+"</li>")
>        .click( function(){
>        var i = $(  this  ).index( this );
>
>        alert( i );
>
>        });
> });
>
> im trying to get the index into the event. either the index that i
> have already defined before the event
> or extracting it from the element with the event on it...
>
> many thanks

Reply via email to