Many of you would have looked into that fancy hovering box that appears in facebook or twitter and wondered how to use in that your site. :) Well, today I’m going to explain using a demo using hovercard. :D

First you will need the js file of course.

Then HTML part:

1
2
3
<div class="codeblock">Hover over my name.</div>
This demo was prepared by <label id="profile">Kumar Anirudha</label>.<br />
For Demo purposes. Blah blah. Fill up anything you like.<br /><br />Open Source Enthusiast.

Of course you are free to change the content. :)

The CSS file:

1
2
3
4
5
6
7
8
body
{
font-family:Sans-serif;
font-size:13px;
padding:20px;
}
.hc-name, a{ color: #1de2d1}
.codeblock{padding:5px; background:#aaddaa;margin-bottom:10px;font-weight:bold;}

You can change the color and everything. But better don’t change the attributes. Or make to change the attributes in the js file too.

The JS part:

1
2
3
4
5
6
7
8
9
10
11
12
13
var aboutMe = {
name: "Kumar Anirudha",
link: "http://anistark.github.io/blog/",
bio: "Kumar Anirudha is a freelance Web-developer and blogger. This is only for demo purpose only. You are free to Fork it and use and your own risk.",
image: "http://www.gravatar.com/avatar/956e7358fe55faf73f6a8864745334e2.png",
website: "http://anistark.github.io/",
email: "anirudhastark@yahoo.com"
};
$('#profile').hovercard({
showCustomCard: true,
customCardJSON: aboutMe
});

This contains the box content. So, Put in here whatever you wish to put in and it’ll be showed on hover.

A small demo has been shown.
You can also use it with Facebook API and twitter API.

Here is the full code:

You will however need to add jquery file since it is a jquery based application. :) In case of any problem, please comment below.