ok, so what i'm trying to do is a plugin that returns a jquery array to be used in a callback function.
let's say that i have this code``
(function($){
$.fn.extend({
//plugin name
myPlugin : function(needed){
var defaults = {
path : 'action.php',
source : ''
}
var needed = $.extend(defaults,needed);
//return
return this.each(function(){
//it loads some pictures
$('#selector').load(needed.path,{'src':nedeed.source})
});
}
});
})(jQuery);
i want to return those pictures and have acces to them in a callback function. something like this
$('#another_selector').click(function(){
$(this).myPlugin({'source':'path/...etc'},function(){
$('img').click(function(){
$(this).remove();
});
});
});
thanks