-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjquery.addsocial.js
60 lines (52 loc) · 1.75 KB
/
jquery.addsocial.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
59
(function ($) {
$.fn.extend({
addSocial: function (options) {
var defaults = {
};
var options = $.extend(defaults, options);
var twsrc = 'http://platform.twitter.com/widgets/tweet_button.html?' + $.param({
count : 'vertical',
url : window.location.href,
text : document.title
});
var fbsrc = 'http://www.facebook.com/plugins/like.php?' + $.param({
href : window.location.href,
layout : 'box_count',
width : 450,
height : 80,
action : 'like',
font : 'verdana',
show_faces : true,
colorscheme : 'light'
});
var tw = $("<iframe>").attr({
allowTransparency : true,
frameborder : 0,
scrolling : 'no',
src : twsrc
}).css({
border : 'none',
overflow : 'hidden',
width : '65px',
height : '65px'
});
var fb = $('<iframe>').attr({
allowTransparency : true,
frameborder : 0,
scrolling : 'no',
src : fbsrc
}).css({
border : 'none',
overflow : 'hidden',
width : '80px',
height : '65px'
});
this.append(
$("<div>").html(tw).css({'float': 'left'}),
$("<div>").html(fb).css({'float': 'left'}),
$("<div>").css({clear: 'both'})
);
return this;
}
});
})(jQuery);