That would require a change in the moveCodeToImg function. A naive 
example would be:

function moveCodeToImg(element) {
    // Catch $().each() calls of the function
    if (typeof element == 'number') element = this;
    // do stuff to element
}

-blair

Abel Tamayo wrote:
> Wow, thanks everyone for the superfast response.
> Ok, as Brandon suggested, the right way was using
>
> $('.oneClass').each(function() { moveCodeToImg(this); });
>
> wich I had already tried but didn't realize i had to change some 
> things in the function used since i was recycling it and the 
> parameters and variables returned where all new (also, don't see why 
> you have to use the reserved word function() when moveCodeToImg is 
> already a function, the kind of paramenter that each(function) 
> expects, but anyway). Now I'm intrigued about Mike's answer:
>
> $('.oneClass').each(moveCodeToImg);
>
> since I don't remember reading about sintax like that in the 
> documentation of jQuery. How come you can call a function without 
> parentheses and the parameters it expects and how do you rearrange a 
> function to receive an "index" or where can i read more about this 
> nomenclature?
>
> Thanks again. Great community.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to