each and binding functions
Hi everyone,
i'm trying to develop this plugin
- ( function($) {
-
- $.fn.extend({
-
- imageSwapper: function( options ) {
- /*
- * some code
- */
- $(this).find('img.image-swapping').each(function(){
- $(this).fadeImageSwapped(options);
- });
-
- }
- });
- }) ( jQuery );
- ( function($) {
-
- $.fn.extend({
-
- fadeImageSwapped: function( options ) {
- alert($(this).attr("src"));
- }
- });
- }) ( jQuery );
The problem is that when i'm calling this
- $(this).fadeImageSwapped(options);
i obtain only one alert.
Can anyone help me understand this behaviour?
Thanks