Virendra Rajput

Code the WWW

Create Facebook Like Alert Notifications With CSS and Jquery

I ve always liked the Facebook’s Alert Notifications. They look very simple and decent. And I always wanted to have such simple notifications on my websites.

Demo

Download

The “Simplicity” is what makes them look really good. The way they simply pop out and disappear.

So I pulled out my sleeves and made one for myself. A very similar to Facebook’s one.

So here’s the CSS for our simple little Alert Box. You can always edit as per your needs though.

And here’s the JS code that I used to pop it out and make it vanish after a Timeout. I made a function for this called “alert()” which takes 2 arguments. First is the “textToshow” which surely the text/ notification you need to show. And the second is the “timeToShow” which is the time the notification should be shown to the user in milliseconds.

I ve also created a Fiddle for this.

Feel free to use it the way you want.

Signing Up Using Facebook PHP and JS SDK

Today a lot of web apps/sites use Facebook for signing up users for their websites. As users generally dont like to fill out registration forms for every new site they visit. So here s a script that uses Facebook Authentication to register users.

Demo

Download

Here s what you need to edit in the script First you need to create a DB. Then create a table for signups.

Then you need to edit the following configurations in the “db/dbconfig.php” file

You need to have a Facebook App ID and App secret. You can create an Facebook App here So just add your app ID and app secret in the “index.php” & “home.php”

And finally add your Redirect URI in the “index.php” as show in the gist

If you have any concerns or issues you can send a Pull Request on Github