Ciao a tutti,
vi espongo subito il codice / problema
codice:
( function($) {
$.fn.extend({
imageSwapper: function( options ) {
/*
* codice
*/
$(this).find('img.image-swapping').each(function(){
$(this).fadeImageSwapped(options);
});
}
});
}) ( jQuery );
( function($) {
$.fn.extend({
fadeImageSwapped: function( options ) {
alert($(this).attr("src"));
}
});
}) ( jQuery );
Qualcuno sa dirmi perché quando eseguo
codice:
$(this).fadeImageSwapped(options);
ottengo l'alert solo del primo elemento anche se il selettore ne restituiisce 4? (ho fatto un alert di $(this).find('img.image-swapping').length per sapere che ne sono 4).
Se qualcuno volesse illuminarmi gliene sarei davvero grato.
Leandro