Use the $.each function against a query for the "photoframe" class:

$.each($('.photoframe'), function( index, elem) {
     // Wrapper methods here, using elem as the reference to each
element.
     ...
}

That should do it.   For more, check out Visual JQuery (http://
visualjquery.com/1.1.2.html), under JavaScript > $.each(obj, fn)

Jocko


Chris - Implied By Design wrote:
> > It's hard to tell without seeing the rest of the markup, but I'm
> > guessing you have more than one element with class="photoframe".
>
> Exactly. The function builds a table around each element with the
> class 'photoframe'.
>
> > If that is the case, you could change this ...
> > var photo = $('.photoframe');
> > to this ...
> > var photo = $('.photoframe:first');
> > That way it'll insert a table before the first .photoframe.
>
> That works great for the first one. Is there a way to iterate through
> each one and have each instance of the "photoframe" class get wrapped,
> instead of just the first? That's the functionality I'm going for. I
> noticed that if I use append('test') for instance, it doesn't
> duplicate the content. I'm guessing that the $('.photoframe') object
> is composed of all of the content of all of the elements matching the
> 'photoframe' class? How would I get out the right content for each
> matching element, to put back with the append()?

Reply via email to