(function($) {
    var $window = $(window);

    $.fn.myLoader = function(options) {

        // Configuration
        // Configuration
        options = $.extend({
            callback: jQuery.noop
        }, options);

        var images = this;
        $.each(images, function(key, value) {
            loadImage($(value));
        });

        options.callback.call();

        // Main function --> Load the images copying the "data-href" attribute into the "src" attribute
        function loadImage($img) {
            $img.hide();
            $img.attr("src", $img.attr("data-href"));
            $img.removeAttr('data-href');
        }

    };
} (jQuery));

