Alternative facebook badge for pages.
Do not use the library on a live site. The library does not work properly. It is a consequence of changes in the facebook policy.
Insert before the closing tag head:
<!-- Include widget styles -->
<link rel="stylesheet" href="css/fbplus.badge.css">
Insert widget code on your page:
<!-- Place this tag where you want the widget to render -->
<div id="FBplusBadge" data-width="240" data-href="https://facebook.com/{page name}" data-rel="page" data-theme="light" data-lang="en"></div>
<!-- Place this tag after the last widget tag -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'js/fbplus.badge.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
See demo as example.
Options can be passed as a data attributes.
Name | Type | Default | Description |
---|---|---|---|
data-width | string | 240px | value in the range of 160 - 420 pixels |
data-href | string | --- | you can use full link on page or only name |
data-rel | string | page | currently widget is relevant only for facebook pages |
data-theme | string | light | accepts: 'light' or 'dark' |
data-lang | string | en | available values: 'en', 'de', 'fr', 'it', 'es', 'pt', 'ru', 'ua' |
NOTE: this list related to data attribute 'data-lang'.
Abbr | Language |
---|---|
en | English |
de | German |
fr | French |
it | Italian |
es | Spanish |
pt | Portuguese |
ru | Russian |
ua | Ukrainian |
Google Chrome, Firefox, Safari, Opera, Internet Explorer 8+
Demo version here shtange.github.io/fbplus
Review on Habrahabr (russian language)
Released under the MIT License