Hi Raymond,

I'm not sure if this is less cpu intensive, but at least it's more
jQuery:

$('div.box').each(function() {
  var $snippet = $(this).find('dd p').html();
  $(this).append('<div class="summary"><p class="sml">' + $snippet +
'</p></div>');
});

--
Bohdan Ganicky

On Jan 24, 12:01 am, Raymond <[EMAIL PROTECTED]>
wrote:
> I was wondering if anyone knows of a less processor intensive way of
> doing the following code?
>
> I am trying to loop over all classes of a certain type on the page and
> then append some html that is contained within that particular class.
> What it is doing to the user is collapsing the search results into a
> "summary" of each as the length of the original result set can be long
> to scroll through.
>
> var count = 0;
>                         $('div.box').each(function()
>                         {
>                                 $('div.box:eq(' + count + ')').append('<div 
> class="summary"><p
> class="sml">' + $('div.box:eq(' + count + ') dd p').html() + '</p></
> div>');
>                                 count = count + 1;
>                         });

Reply via email to