jQuery-Avatar Plugin

How to setup

Pre-required :

To use this plugin, user need following dependencies
  • jQuery 1.7 or higher (Required)
  • bootstrap.js (Optional)
  • Installation Process:

    It's very easy to integrate this plugin into your web page

    Step 1: Add element like

    <div data-avatar="John Deo" class="avatarBlock"></div>

    Step 2: Include plugin assets file into your web page

    <link rel="stylesheet" type="text/css" href="css/gravatar.css">
    <script type="text/javascript" src="js/gravatar.min.js"></script>

    Step 3: Initialize the script on element

    $('.avatarBlock').avatar();

    And it's done. Plugin is ready to perform.

    Let's check some examples

    Example 2: Show image

    <div data-avatar="John Deo" class="avatarBlock round" data-image-src="/broken-image-src"></div>
    <div data-avatar="Sachin Jain" class="avatarBlock round" data-image-src="/src/image"></div>
    Result:

    Note: Plugin will automatically check for broken image link and handle viewaccordingly.