Load your Gravatar images like:
<img data-gravatar_hash="713072bbe89035a79c17d19e53dd5d9b"
class="load-gravatar" height="64" width="64"
src="https://secure.gravatar.com/avatar/00000000000000000000000000000000?s=64&d=mm" />A PHP example of this would be:
<img data-gravatar_hash="<?php echo md5( strtolower( trim( $email ) ) ); ?>"
class="load-gravatar" height="64" width="64"
src="https://secure.gravatar.com/avatar/00000000000000000000000000000000?s=64&d=mm" />Then trigger the real images to load via:
jQuery( document ).ready( function() {
$( '.load-gravatar' ).async_gravatars( {
ssl: true
} );
} );Original blog post http://josephscott.org/archives/2011/05/delayed-loading-gravatars/
Demo page http://josephscott.org/code/javascript/async-gravatars/
License is MIT style.