Skip to content

Instantly share code, notes, and snippets.

@chernomyrdin
Created December 16, 2011 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chernomyrdin/1483843 to your computer and use it in GitHub Desktop.
Save chernomyrdin/1483843 to your computer and use it in GitHub Desktop.
Bloger Float button
function share42 (f,u,t,m1,m2) {
if (!u) {
u = location.href;
}
u = encodeURIComponent(u);
if (!t) {
t = document.title;
}
t = encodeURIComponent(t);
if (!m1) {
m1 = 150;
}
if (!m2) {
m2 = 20;
}
document.write('<span id="share42">');
var s = new Array(
'"#" onclick="window.open('
+ "'http://www.blogger.com/blog_this.pyra?t&u=" + u + '&n=' + t + "',"
+ "'_blank',"
+ "'scrollbars=0, resizable=1, menubar=0, left=200, top=200, width=550, height=440, toolbar=0, status=0'"
+ ');return false"'
+ ' title="Опубликовать в Blogger.com"'
);
for(i=0;i<s.length;i++) {
document.write(
'<a rel="nofollow" style="display:block;width:32px;height:32px;margin:0 0 6px;outline:none;'
+ 'background:url(' + f + 'icons.png) -' + 32*i +'px 0"'
+ ' href=' + s[i]
+ ' target="_blank"></a>'
);
}
document.write('</span>');
window.onload = function () {
var p = document.getElementById('share42');
function m () {
var top=Math.max(document.body.scrollTop,document.documentElement.scrollTop);
if (top+m2<m1) {
p.style.top=m1-top+'px';
}
else {
p.style.top=m2+'px';
}
}
m();
window.onscroll = m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment