Hi,
I get some HTML using an ajax call (using$.get() ). Now I want to apply some jquery plugin function on few elements of returned HTML
The HTML I get from server is of this form
<div id='groupcontainer'>
<section class="group">
<a class="photo_hover3" href="#"><img src="http://i.feedimg.com/120x120!/1" alt="picture1"/></a>
</section>
<section class="group">
<a class="photo_hover3" href="#"><img src="http://i.feedimg.com/120x120!/2" alt="picture2"/></a>
</section>
<section class="group">
<a class="photo_hover3" href="#"><img src="http://i.feedimg.com/120x120!/2" alt="picture2"/></a>
</section>
</div>
then I append this HTML to another element.
I want to apply pShadow() on every (previously not on applied) <a> with class "photo_hover3"
this works for me:
$('#gallery').append(data);
var untouched = $('#gallery > #groupcontainer');
untouched.last().find('.photo_hover3').pShadow();
now the biggest problem is on very ajax call (which I make alot), it has to run last() and then find() which I assume are not just memory intensive but they also make page loading very slow (after #gallery becomes large enough).
I want to apply pShodow() before appending data to #gallery
something like
data = $(data)........pShadow();
$('#gallery').append(data);
any idea how can this be done?