$.fn.crossfade = function () {
  return this.each(function () { 
    var $$ = $(this);
    $$.hover(function () {
      $$.stop().animate({
          opacity: 0
      }, 350);
    }, function () {
      $$.stop().animate({
          opacity: 1
      }, 350);
    });
  });
};
$(window).bind('load', function () {
  // run the cross fade plugin against selector
  $('img.fade').crossfade();
});