forked from andrewdisley/jquery-facebook-like-button
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.fblike.js
58 lines (45 loc) · 1.19 KB
/
jquery.fblike.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
;(function($) {
/*
jquery.fbLike.js
A jQuery wrapper to create a Facebook Like Button
Created by Henning Thies
http://github.com/henningthies
*/
$.fn.fbLike = function(url, options) {
var opts = $.extend({}, $.fn.fbLike.defaults, options);
return this.each(function() {
var $this = $(this);
var _url = "http://www.facebook.com/plugins/like.php?";
_url += "href="+url;
_url += "&layout="+opts.layout;
_url += "&show_faces="+opts.show_faces;
_url += "&width="+opts.width;
_url += "&height="+opts.height;
_url += "&action="+opts.verb;
_url += "&font="+opts.font;
_url += "&colorscheme="+opts.color;
var $iframe = $("<iframe>",{
scrolling: opts.scrolling,
frameborder: opts.frameborder,
allowTransparency: opts.allowTransparency,
src:_url
});
$iframe.ready(function(){
$this.append($iframe[0]);
});
});
};
// default options
$.fn.fbLike.defaults = {
scrolling: "no",
frameborder: 0,
allowTransparency:true,
layout: "standard",
show_faces: true,
width: 450,
height: 21,
verb: "like",
font: "arial",
color: "light"
};
})(jQuery);